Skip to content

Commit 1f42ea9

Browse files
committed
remove usage of dead trackers
1 parent a959782 commit 1f42ea9

18 files changed

Lines changed: 30 additions & 30 deletions

File tree

jam-api/src/main/java/com/intellij/jam/model/common/JamSupportMetaData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public Object[] getDependences() {
5959
if (myElement != null) {
6060
final List<Object> deps = new SmartList<Object>();
6161
deps.add(getDeclaration());
62-
deps.add(PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT);
62+
deps.add(PsiModificationTracker.MODIFICATION_COUNT);
6363
for (final DomElement domElement : ModelMergerUtil.getImplementations(myElement, DomElement.class)) {
6464
if (domElement.isValid()) {
6565
deps.add(DomUtil.getFileElement(domElement));
@@ -68,7 +68,7 @@ public Object[] getDependences() {
6868
return deps.toArray();
6969
}
7070

71-
return new Object[]{getDeclaration(), PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT};
71+
return new Object[]{getDeclaration(), PsiModificationTracker.MODIFICATION_COUNT};
7272
}
7373

7474
@NonNls

jam-api/src/main/java/com/intellij/jam/model/util/JamCommonUtil.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public static Collection<PsiClass> getAnnotationTypesWithChildren(
370370
cachedValue = CachedValuesManager.getManager(module.getProject()).createCachedValue(
371371
() -> {
372372
final Collection<PsiClass> classes = getAnnotationTypesWithChildren(annotationName, module);
373-
return new CachedValueProvider.Result<>(classes, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
373+
return new CachedValueProvider.Result<>(classes, PsiModificationTracker.MODIFICATION_COUNT);
374374
},
375375
false
376376
);
@@ -409,7 +409,7 @@ public static Collection<PsiClass> getAnnotatedTypes(
409409
} else {
410410
classes = getChildren(psiClass, scope);
411411
}
412-
return new CachedValueProvider.Result<>(classes, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT);
412+
return new CachedValueProvider.Result<>(classes, PsiModificationTracker.MODIFICATION_COUNT);
413413
}, false);
414414

415415
module.putUserData(key, cachedValue);
@@ -558,7 +558,7 @@ public static <T extends JamElement> CachedValue<List<T>> createClassCachedValue
558558
}
559559
}
560560
}
561-
return new CachedValueProvider.Result<>(result, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
561+
return new CachedValueProvider.Result<>(result, PsiModificationTracker.MODIFICATION_COUNT);
562562
}, false);
563563
}
564564

jam-api/src/main/java/com/intellij/jam/reflect/JamChildrenQuery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public final List<Jam> findChildren(@Nonnull PsiElementRef<? extends PsiMember>
6969
if (data == null) {
7070
parent.putUserData(myCacheKey, data = CachedValuesManager.getManager(parent.getProject()).createCachedValue(new CachedValueProvider<List<Jam>>() {
7171
public Result<List<Jam>> compute() {
72-
return Result.create(findChildren(parent), PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
72+
return Result.create(findChildren(parent), PsiModificationTracker.MODIFICATION_COUNT);
7373
}
7474
}, false));
7575
}

java-execution-impl/src/main/java/com/intellij/java/execution/impl/junit/JUnitUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public static boolean isTestClass(@Nonnull PsiClass psiClass, boolean checkAbstr
233233

234234
return LanguageCachedValueUtil.getCachedValue(
235235
psiClass,
236-
() -> CachedValueProvider.Result.create(hasTestOrSuiteMethods(psiClass), PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT)
236+
() -> CachedValueProvider.Result.create(hasTestOrSuiteMethods(psiClass), PsiModificationTracker.MODIFICATION_COUNT)
237237
);
238238
}
239239

@@ -342,7 +342,7 @@ public static boolean isJUnit5TestClass(@Nonnull final PsiClass psiClass, boolea
342342
}
343343
}
344344
}
345-
return CachedValueProvider.Result.create(hasAnnotation, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
345+
return CachedValueProvider.Result.create(hasAnnotation, PsiModificationTracker.MODIFICATION_COUNT);
346346
});
347347
}
348348

java-language-api/src/main/java/com/intellij/java/language/codeInsight/TestFrameworks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ public boolean isTestOrConfig(PsiClass psiClass) {
6363

6464
@Nullable
6565
public static TestFramework detectFramework(@Nonnull final PsiClass psiClass) {
66-
return LanguageCachedValueUtil.getCachedValue(psiClass, () -> CachedValueProvider.Result.create(computeFramework(psiClass), PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT));
66+
return LanguageCachedValueUtil.getCachedValue(psiClass, () -> CachedValueProvider.Result.create(computeFramework(psiClass), PsiModificationTracker.MODIFICATION_COUNT));
6767
}
6868

6969
@Nonnull
7070
public static Set<TestFramework> detectApplicableFrameworks(@Nonnull final PsiClass psiClass) {
71-
return LanguageCachedValueUtil.getCachedValue(psiClass, () -> CachedValueProvider.Result.create(computeFrameworks(psiClass), PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT));
71+
return LanguageCachedValueUtil.getCachedValue(psiClass, () -> CachedValueProvider.Result.create(computeFrameworks(psiClass), PsiModificationTracker.MODIFICATION_COUNT));
7272
}
7373

7474
private static Set<TestFramework> computeFrameworks(PsiClass psiClass) {

java-language-api/src/main/java/com/intellij/java/language/psi/LambdaUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public static MethodSignature getFunction(final PsiClass psiClass) {
193193
@Nonnull
194194
@Override
195195
public Result<MethodSignature> compute() {
196-
return Result.create(calcFunction(psiClass), PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
196+
return Result.create(calcFunction(psiClass), PsiModificationTracker.MODIFICATION_COUNT);
197197
}
198198
});
199199
}

java-language-api/src/main/java/com/intellij/java/language/psi/PsiDisjunctionType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public PsiDisjunctionType(@Nonnull List<PsiType> types, @Nonnull PsiManager psiM
5252
break;
5353
}
5454
}
55-
return CachedValueProvider.Result.create(lub, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT);
55+
return CachedValueProvider.Result.create(lub, PsiModificationTracker.MODIFICATION_COUNT);
5656
}, false);
5757
}
5858

java-language-impl/src/main/java/com/intellij/java/language/impl/codeInsight/MetaAnnotationUtil.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static Collection<PsiClass> getAnnotationTypesWithChildren(@Nonnull Modul
8080
GlobalSearchScope effectiveSearchScope = getAllAnnotationFilesScope(project).intersectWith(moduleScope);
8181
return getAnnotationTypesWithChildren(annotationClass, effectiveSearchScope);
8282
});
83-
return CachedValueProvider.Result.create(factoryMap, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
83+
return CachedValueProvider.Result.create(factoryMap, PsiModificationTracker.MODIFICATION_COUNT);
8484
});
8585

8686
return map.get(pair(annotationName, includeTests));
@@ -121,7 +121,7 @@ public static Collection<PsiClass> getAnnotatedTypes(@Nonnull Module module, @No
121121
} else {
122122
classes = getChildren(psiClass, scope);
123123
}
124-
return new CachedValueProvider.Result<>(classes, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT);
124+
return new CachedValueProvider.Result<>(classes, PsiModificationTracker.MODIFICATION_COUNT);
125125
}, false);
126126
}
127127

@@ -146,7 +146,7 @@ private static GlobalSearchScope getAllAnnotationFilesScope(Project project) {
146146
}
147147

148148
scope = GlobalSearchScope.filesWithLibrariesScope(project, allAnnotationFiles);
149-
return CachedValueProvider.Result.createSingleDependency(scope, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
149+
return CachedValueProvider.Result.createSingleDependency(scope, PsiModificationTracker.MODIFICATION_COUNT);
150150
});
151151
}
152152

@@ -209,7 +209,7 @@ private static PsiAnnotation metaAnnotationCached(PsiClass subjectAnnotation, St
209209
return LanguageCachedValueUtil.getCachedValue(subjectAnnotation, () ->
210210
{
211211
ConcurrentMap<String, PsiAnnotation> metaAnnotationsMap = ConcurrentFactoryMap.createMap(anno -> findMetaAnnotation(subjectAnnotation, anno, new HashSet<>()));
212-
return new CachedValueProvider.Result<>(metaAnnotationsMap, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
212+
return new CachedValueProvider.Result<>(metaAnnotationsMap, PsiModificationTracker.MODIFICATION_COUNT);
213213
}).get(annotationToFind);
214214
}
215215

java-language-impl/src/main/java/com/intellij/java/language/impl/psi/impl/PsiClassImplUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ private static class ByNameCachedValueProvider implements ParameterizedCachedVal
409409
@Override
410410
public CachedValueProvider.Result<Map<GlobalSearchScope, MembersMap>> compute(@Nonnull final PsiClass myClass) {
411411
final Map<GlobalSearchScope, MembersMap> map = ConcurrentFactoryMap.createMap(scope -> new MembersMap(myClass, scope));
412-
return CachedValueProvider.Result.create(map, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT);
412+
return CachedValueProvider.Result.create(map, PsiModificationTracker.MODIFICATION_COUNT);
413413
}
414414
}
415415

java-language-impl/src/main/java/com/intellij/java/language/impl/psi/impl/PsiSuperMethodImplUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,9 @@ public static HierarchicalMethodSignature getHierarchicalMethodSignature(@Nonnul
459459
}
460460

461461
if (!method.isPhysical() && !(method instanceof SyntheticElement) && !(method instanceof LightElement)) {
462-
return CachedValueProvider.Result.create(result, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT, method);
462+
return CachedValueProvider.Result.create(result, PsiModificationTracker.MODIFICATION_COUNT, method);
463463
}
464-
return CachedValueProvider.Result.create(result, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
464+
return CachedValueProvider.Result.create(result, PsiModificationTracker.MODIFICATION_COUNT);
465465
};
466466

467467
@Nonnull

0 commit comments

Comments
 (0)