mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[java-inspections] IDEA-374865 ClassCanBeRecord: fix edge case with method call in anonymous class constructor
In response to IJ-CR-167896 GitOrigin-RevId: 3915e8b287cdeaeaf1fdfc436661110f84d76434
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b4967bd2ed
commit
384493143b
+11
-1
@@ -260,7 +260,17 @@ final class ConstructorBodyProcessor {
|
||||
|
||||
@Override
|
||||
public void visitClass(PsiClass aClass) {
|
||||
// Empty on purpose.
|
||||
if (aClass instanceof PsiAnonymousClass anonymousClass) {
|
||||
PsiExpressionList arguments = anonymousClass.getArgumentList();
|
||||
if (arguments != null) {
|
||||
for (PsiExpression expression : arguments.getExpressions()) {
|
||||
if (hasReferenceToContainingClass(containingClass, expression)) {
|
||||
markInvalid();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user