mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
annotation type: error for duplicated methods (IDEA-128675)
This commit is contained in:
@@ -257,8 +257,13 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
|
||||
}
|
||||
|
||||
myHolder.add(AnnotationsHighlightUtil.checkValidAnnotationType(method.getReturnTypeElement()));
|
||||
myHolder.add(AnnotationsHighlightUtil.checkCyclicMemberType(method.getReturnTypeElement(), method.getContainingClass()));
|
||||
final PsiClass aClass = method.getContainingClass();
|
||||
myHolder.add(AnnotationsHighlightUtil.checkCyclicMemberType(method.getReturnTypeElement(), aClass));
|
||||
myHolder.add(AnnotationsHighlightUtil.checkClashesWithSuperMethods(method));
|
||||
|
||||
if (!myHolder.hasErrorResults() && aClass != null) {
|
||||
myHolder.add(HighlightMethodUtil.checkDuplicateMethod(aClass, method, getDuplicateMethods(aClass)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
@interface Example {
|
||||
<error descr="'myMethod()' is already defined in 'Example'">public String myMethod()</error>;
|
||||
<error descr="'myMethod()' is already defined in 'Example'">public int myMethod()</error>;
|
||||
}
|
||||
@@ -41,6 +41,7 @@ public class AnnotationsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testDuplicateTarget() { doTest(false); }
|
||||
public void testPingPongAnnotationTypesDependencies() { doTest(false);}
|
||||
public void testClashMethods() { doTest(false);}
|
||||
public void testDupMethods() { doTest(false);}
|
||||
|
||||
public void testInvalidPackageAnnotationTarget() { doTest(BASE_PATH + "/" + getTestName(true) + "/package-info.java", false, false); }
|
||||
public void testPackageAnnotationNotInPackageInfo() { doTest(BASE_PATH + "/" + getTestName(true) + "/notPackageInfo.java", false, false); }
|
||||
|
||||
Reference in New Issue
Block a user