mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
Java: don't warn about infinite recursion on red code
GitOrigin-RevId: b136b315a1213d2526581b7281bbc81161dfb57e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6916b6b005
commit
fb700afa0e
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2012 Dave Griffith, Bas Leijdekkers
|
||||
* Copyright 2003-2024 Dave Griffith, Bas Leijdekkers
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,8 +37,7 @@ class RecursionVisitor extends JavaRecursiveElementWalkingVisitor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitMethodCallExpression(
|
||||
@NotNull PsiMethodCallExpression call) {
|
||||
public void visitMethodCallExpression(@NotNull PsiMethodCallExpression call) {
|
||||
if (recursive) {
|
||||
return;
|
||||
}
|
||||
@@ -48,12 +47,11 @@ class RecursionVisitor extends JavaRecursiveElementWalkingVisitor {
|
||||
return;
|
||||
}
|
||||
final PsiReferenceExpression methodExpression = call.getMethodExpression();
|
||||
final String calledMethodName = methodExpression.getReferenceName();
|
||||
if (!methodName.equals(calledMethodName)) {
|
||||
if (!methodName.equals(methodExpression.getReferenceName())) {
|
||||
return;
|
||||
}
|
||||
final PsiMethod calledMethod = call.resolveMethod();
|
||||
if (!method.equals(calledMethod)) {
|
||||
JavaResolveResult resolveResult = call.resolveMethodGenerics();
|
||||
if (!resolveResult.isValidResult() || !method.equals(resolveResult.getElement())) {
|
||||
return;
|
||||
}
|
||||
if (method.hasModifierProperty(PsiModifier.STATIC) || method.hasModifierProperty(PsiModifier.PRIVATE)) {
|
||||
|
||||
@@ -177,6 +177,10 @@ class IndirectRecursion2 {
|
||||
|
||||
class IndirectRecursionNoWarning {
|
||||
|
||||
void brokenCode(int i) {
|
||||
brokenCode<error descr="Expected 1 argument but found 2">(1, 2)</error>;
|
||||
}
|
||||
|
||||
int i = 1;
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
Reference in New Issue
Block a user