mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
[java-highlighting] Avoid duplicate highlighting for duplicate classes when dangling modifier lists are present inside the class
Fixes IDEA-370725 Multiple 'Duplicate class' errors for the same class GitOrigin-RevId: 1712abbfd7594028d839b5962c5a4ca13881250f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5a566db19b
commit
69fc3018bb
@@ -480,7 +480,7 @@ final class JavaErrorVisitor extends JavaElementVisitor {
|
||||
if (error != null) report(error);
|
||||
}
|
||||
}
|
||||
else if (parent instanceof PsiClass aClass) {
|
||||
else if (parent instanceof PsiClass aClass && aClass.getModifierList() == list) {
|
||||
if (!hasErrorResults()) myClassChecker.checkDuplicateNestedClass(aClass);
|
||||
if (!hasErrorResults() && !(aClass instanceof PsiAnonymousClass)) {
|
||||
/* an anonymous class is highlighted in HighlightClassUtil.checkAbstractInstantiation()*/
|
||||
|
||||
@@ -72,4 +72,13 @@ class ok {
|
||||
class ok2 {
|
||||
public ok2() {}
|
||||
public void ok2() {}
|
||||
}
|
||||
|
||||
public class Outer {
|
||||
public class <error descr="Duplicate class: 'Outer'">Outer</error> {
|
||||
public<error descr="Identifier or type expected">;</error>
|
||||
public<error descr="Identifier or type expected">;</error>
|
||||
public<error descr="Identifier or type expected">;</error>
|
||||
public<error descr="Identifier or type expected">;</error>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user