[331970] Performance: persist and restore EAR Libraries classpath container
diff --git a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/builder/DependencyGraphImpl.java b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/builder/DependencyGraphImpl.java
index f53db7e..06f569f 100644
--- a/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/builder/DependencyGraphImpl.java
+++ b/plugins/org.eclipse.wst.common.modulecore/modulecore-src/org/eclipse/wst/common/componentcore/internal/builder/DependencyGraphImpl.java
@@ -747,22 +747,22 @@
} else {
HashMap <String, Set<String>>savedMap = null;
FileInputStream fIn = null;
+ boolean deleteCache = true;
try{
fIn = new FileInputStream(file);
BufferedInputStream bIn = new BufferedInputStream(fIn);
ObjectInputStream oIn = new ObjectInputStream(bIn);
savedMap = (HashMap<String, Set<String>>)oIn.readObject();
oIn.close();
+ deleteCache = false;
} catch (FileNotFoundException e) {
ModulecorePlugin.logError(e);
return null;
} catch (IOException e) {
ModulecorePlugin.logError(e);
- file.delete();
return null;
} catch (ClassNotFoundException e) {
ModulecorePlugin.logError(e);
- file.delete();
return null;
} finally{
if(fIn != null){
@@ -772,6 +772,9 @@
ModulecorePlugin.logError(e);
}
}
+ if(deleteCache){
+ file.delete();
+ }
}
if(savedMap != null){ // we have something to restore the state from
//first check to ensure all projects are still present
@@ -817,7 +820,7 @@
}
}
}
- } catch (Exception e){
+ } catch (Throwable e){
try{
ModulecorePlugin.logError(e);
IPath stateLocation = ModulecorePlugin.getDefault().getStateLocation();
@@ -983,7 +986,7 @@
}
};
checkRestoreDataJob.setSystem(true);
- checkRestoreDataJob.setRule(null);
+ checkRestoreDataJob.setRule(ResourcesPlugin.getWorkspace().getRoot());
checkRestoreDataJob.schedule();
}