vcs: cleanup - rename methods

This commit is contained in:
Aleksey Pivovarov
2018-06-24 16:24:18 +03:00
parent aa16859770
commit 00fe2c2442
4 changed files with 8 additions and 8 deletions
@@ -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) {
@@ -96,7 +96,7 @@ public class VcsHistoryCache {
}
}
public void clear() {
public void clearHistory() {
synchronized (myLock) {
final Iterator<Map.Entry<HistoryCacheBaseKey,CachedHistory>> 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));
}
@@ -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;
@@ -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;