diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java index 94ab2dfd48c4..88e50f3cfe56 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java @@ -92,7 +92,7 @@ public class VcsAnnotationCachedProxy implements AnnotationProvider { VcsAnnotation vcsAnnotation = null; if (revisionNumber != null) { - Object cachedData = myCache.get(filePath, myVcs.getKeyInstanceMethod(), revisionNumber); + Object cachedData = myCache.getAnnotation(filePath, myVcs.getKeyInstanceMethod(), revisionNumber); vcsAnnotation = ObjectUtils.tryCast(cachedData, VcsAnnotation.class); } @@ -115,7 +115,7 @@ public class VcsAnnotationCachedProxy implements AnnotationProvider { if (vcsAnnotation == null) return fileAnnotation; if (revisionNumber != null) { - myCache.put(filePath, myVcs.getKeyInstanceMethod(), revisionNumber, vcsAnnotation); + myCache.putAnnotation(filePath, myVcs.getKeyInstanceMethod(), revisionNumber, vcsAnnotation); } if (myVcs.getVcsHistoryProvider() instanceof VcsCacheableHistorySessionFactory) { diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsHistoryCache.java b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsHistoryCache.java index 052040e683b9..0466a84ef3e1 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsHistoryCache.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsHistoryCache.java @@ -96,7 +96,7 @@ public class VcsHistoryCache { } } - public void clear() { + public void clearHistory() { synchronized (myLock) { final Iterator> iterator = myHistoryCache.entrySet().iterator(); while (iterator.hasNext()) { @@ -108,14 +108,14 @@ public class VcsHistoryCache { } } - public void put(@NotNull final FilePath filePath, @NotNull final VcsKey vcsKey, @NotNull final VcsRevisionNumber number, + public void putAnnotation(@NotNull final FilePath filePath, @NotNull final VcsKey vcsKey, @NotNull final VcsRevisionNumber number, @NotNull final Object vcsAnnotation) { synchronized (myLock) { myAnnotationCache.put(new HistoryCacheWithRevisionKey(filePath, vcsKey, number), vcsAnnotation); } } - public Object get(@NotNull final FilePath filePath, @NotNull final VcsKey vcsKey, @NotNull final VcsRevisionNumber number) { + public Object getAnnotation(@NotNull final FilePath filePath, @NotNull final VcsKey vcsKey, @NotNull final VcsRevisionNumber number) { synchronized (myLock) { return myAnnotationCache.get(new HistoryCacheWithRevisionKey(filePath, vcsKey, number)); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java index 0d46f94e8b76..ff77442ffbf1 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java @@ -156,7 +156,7 @@ public class ProjectLevelVcsManagerImpl extends ProjectLevelVcsManagerEx impleme myContentRevisionCache = new ContentRevisionCache(); myVcsFileListenerContextHelper = vcsFileListenerContextHelper; VcsListener vcsListener = () -> { - myVcsHistoryCache.clear(); + myVcsHistoryCache.clearHistory(); myVcsFileListenerContextHelper.possiblySwitchActivation(hasActiveVcss()); }; myExcludedIndex = excludedFileIndex; diff --git a/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java b/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java index 60648aa6ae96..fb3c76f1c9f8 100644 --- a/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java +++ b/plugins/git4idea/src/git4idea/annotate/GitAnnotationProvider.java @@ -133,14 +133,14 @@ public class GitAnnotationProvider implements AnnotationProviderEx { VcsRevisionNumber actualRevision = revision != null ? revision : vcs.getDiffProvider().getCurrentRevision(file); if (actualRevision != null) { - Object annotatedData = myCache.get(repositoryFilePath, GitVcs.getKey(), actualRevision); + Object annotatedData = myCache.getAnnotation(repositoryFilePath, GitVcs.getKey(), actualRevision); if (annotatedData instanceof CachedData) return restoreFromCache(file, actualRevision, (CachedData)annotatedData); } GitFileAnnotation fileAnnotation = doAnnotate(repositoryFilePath, actualRevision, file); if (actualRevision != null) { - myCache.put(repositoryFilePath, GitVcs.getKey(), actualRevision, cacheData(fileAnnotation)); + myCache.putAnnotation(repositoryFilePath, GitVcs.getKey(), actualRevision, cacheData(fileAnnotation)); } return fileAnnotation;