mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-86016 False positive 'Recursive call' line marker fix
This commit is contained in:
+14
-3
@@ -180,10 +180,21 @@ public class JavaLineMarkerProvider implements LineMarkerProvider, DumbAware {
|
||||
}
|
||||
|
||||
private static boolean isRecursiveMethodCall(@NotNull PsiMethodCallExpression methodCall){
|
||||
PsiMethod referencedMethod = methodCall.resolveMethod();
|
||||
final PsiMethod referencedMethod = methodCall.resolveMethod();
|
||||
|
||||
TextRange rmRange = referencedMethod == null ? null : referencedMethod.getTextRange();
|
||||
int mcOffset = methodCall.getTextRange().getStartOffset();
|
||||
if (referencedMethod == null || !referencedMethod.isValid() || !methodCall.isValid()){
|
||||
return false;
|
||||
}
|
||||
|
||||
final PsiFile methodCallFile = methodCall.getContainingFile();
|
||||
final PsiFile methodFile = referencedMethod.getContainingFile();
|
||||
|
||||
if (methodCallFile == null || methodFile == null || !methodCallFile.equals(methodFile)){
|
||||
return false;
|
||||
}
|
||||
|
||||
final TextRange rmRange = referencedMethod.getTextRange();
|
||||
final int mcOffset = methodCall.getTextRange().getStartOffset();
|
||||
return rmRange != null && rmRange.contains(mcOffset);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user