mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: cleanup - rename methods
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user