deprecate FSCache and remove unnecesary usages (followup IDEA-CR-35372)

This commit is contained in:
Eugene Zhuravlev
2018-11-07 16:35:48 +01:00
parent 18e6944b26
commit 21bc91ea10
4 changed files with 7 additions and 11 deletions
@@ -395,7 +395,6 @@ final class BuildSession implements Runnable, CanceledStatus {
Collection<BuildRootDescriptor> descriptor = pd.getBuildRootIndex().findAllParentDescriptors(file, null, null);
if (!descriptor.isEmpty()) {
if (!cacheCleared) {
pd.getFSCache().clear();
cacheCleared = true;
}
if (LOG.isDebugEnabled()) {
@@ -427,7 +426,6 @@ final class BuildSession implements Runnable, CanceledStatus {
final long stamp = timestamps.getStamp(file, descriptor.getTarget());
if (stamp != fileStamp) {
if (!cacheCleared) {
pd.getFSCache().clear();
cacheCleared = true;
}
pd.fsState.markDirty(null, file, descriptor, timestamps, saveEventStamp);
@@ -87,13 +87,16 @@ public final class ProjectDescriptor {
}
/**
* @Deprecated not used after file traversal rewrite to NIO
* @deprecated not used after file traversal rewrite to NIO
*/
@NotNull
public FSCache getFSCache() {
return myFSCache;
return FSCache.NO_CACHE;
}
/**
* @deprecated not used after file traversal rewrite to NIO
*/
public void setFSCache(FSCache cache) {
myFSCache = cache == null? FSCache.NO_CACHE : cache;
}
@@ -23,8 +23,8 @@ import java.util.Collections;
import java.util.Map;
/**
* @author Eugene Zhuravlev
*/
* @deprecated not used after file traversal rewrite to NIO
*/
public class FSCache {
public static final FSCache NO_CACHE = new FSCache() {
@@ -165,7 +165,6 @@ public class IncProjectBuilder {
public void build(CompileScope scope, boolean forceCleanCaches) throws RebuildRequestedException {
final LowMemoryWatcher memWatcher = LowMemoryWatcher.register(() -> {
myProjectDescriptor.getFSCache().clear();
JavacMain.clearCompilerZipFileCache();
myProjectDescriptor.dataManager.flush(false);
myProjectDescriptor.timestamps.getStorage().force();
@@ -442,10 +441,6 @@ public class IncProjectBuilder {
private CompileContextImpl createContext(CompileScope scope) throws ProjectBuildException {
final CompileContextImpl context = new CompileContextImpl(scope, myProjectDescriptor, myMessageDispatcher, myBuilderParams, myCancelStatus);
// in project rebuild mode performance gain is hard to observe, so it is better to save memory
// in make mode it is critical to traverse file system as fast as possible, so we choose speed over memory savings
myProjectDescriptor.setFSCache(context.isProjectRebuild() ? FSCache.NO_CACHE : new FSCache());
final Callbacks.ConstantAffectionResolver javaResolver = myJavaConstantResolver;
if (javaResolver == null) {
JavaBuilderUtil.CONSTANT_SEARCH_SERVICE.set(context, null);