mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
method contract cache shouldn't depend on the annotation which might become invalid
This commit is contained in:
+9
-11
@@ -1513,12 +1513,12 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
|
||||
}
|
||||
|
||||
static List<MethodContract> getMethodContracts(@NotNull final PsiMethod method) {
|
||||
final PsiAnnotation contractAnno = findContractAnnotation(method);
|
||||
if (contractAnno != null) {
|
||||
return CachedValuesManager.getCachedValue(contractAnno, new CachedValueProvider<List<MethodContract>>() {
|
||||
@Nullable
|
||||
@Override
|
||||
public Result<List<MethodContract>> compute() {
|
||||
return CachedValuesManager.getCachedValue(method, new CachedValueProvider<List<MethodContract>>() {
|
||||
@Nullable
|
||||
@Override
|
||||
public Result<List<MethodContract>> compute() {
|
||||
final PsiAnnotation contractAnno = findContractAnnotation(method);
|
||||
if (contractAnno != null) {
|
||||
String text = AnnotationUtil.getStringAttributeValue(contractAnno, null);
|
||||
if (text != null) {
|
||||
try {
|
||||
@@ -1534,12 +1534,10 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
|
||||
catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
return Result.create(Collections.<MethodContract>emptyList(), contractAnno, method, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
return Result.create(Collections.<MethodContract>emptyList(), method, PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user