mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix compiler caches corruption
This commit is contained in:
@@ -228,6 +228,7 @@ public class CompileDriver {
|
||||
}
|
||||
finally {
|
||||
compileContext.commitZipFiles(); // just to be on the safe side; normally should do nothing if called in isUpToDate()
|
||||
CompilerCacheManager.getInstance(myProject).flushCaches();
|
||||
}
|
||||
}
|
||||
}, null);
|
||||
@@ -455,6 +456,7 @@ public class CompileDriver {
|
||||
compileContext.getMessageCount(CompilerMessageCategory.WARNING),
|
||||
finish - start
|
||||
);
|
||||
CompilerCacheManager.getInstance(myProject).flushCaches();
|
||||
//if (LOG.isDebugEnabled()) {
|
||||
// LOG.debug("COMPILATION FINISHED");
|
||||
//}
|
||||
@@ -792,7 +794,6 @@ public class CompileDriver {
|
||||
finally {
|
||||
// drop in case it has not been dropped yet.
|
||||
dropDependencyCache(context);
|
||||
|
||||
final VirtualFile[] allOutputDirs = context.getAllOutputDirectories();
|
||||
|
||||
if (didSomething && GENERATE_CLASSPATH_INDEX) {
|
||||
|
||||
@@ -23,8 +23,6 @@ import com.intellij.openapi.compiler.generic.GenericCompiler;
|
||||
import com.intellij.openapi.components.ProjectComponent;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.LowMemoryWatcher;
|
||||
import com.intellij.openapi.util.ShutDownTracker;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -48,14 +46,6 @@ public class CompilerCacheManager implements ProjectComponent {
|
||||
private final Map<GenericCompiler<?,?,?>, GenericCompilerCache<?,?,?>> myGenericCachesMap = new HashMap<GenericCompiler<?,?,?>, GenericCompilerCache<?,?,?>>();
|
||||
private final List<Disposable> myCacheDisposables = new ArrayList<Disposable>();
|
||||
private final File myCachesRoot;
|
||||
private LowMemoryWatcher myMemWatcher;
|
||||
|
||||
private final Runnable myShutdownTask = new Runnable() {
|
||||
public void run() {
|
||||
flushCaches();
|
||||
}
|
||||
};
|
||||
|
||||
private final Project myProject;
|
||||
|
||||
public CompilerCacheManager(Project project) {
|
||||
@@ -68,18 +58,9 @@ public class CompilerCacheManager implements ProjectComponent {
|
||||
}
|
||||
|
||||
public void projectOpened() {
|
||||
myMemWatcher = LowMemoryWatcher.register(new LowMemoryWatcher.ForceableAdapter() {
|
||||
public void force() {
|
||||
flushCaches();
|
||||
}
|
||||
});
|
||||
ShutDownTracker.getInstance().registerShutdownTask(myShutdownTask);
|
||||
}
|
||||
|
||||
public void projectClosed() {
|
||||
myMemWatcher.stop();
|
||||
ShutDownTracker.getInstance().unregisterShutdownTask(myShutdownTask);
|
||||
flushCaches();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user