IDEA-117894 Incorrect warning of 'non-varags methods overrides varargs method'

This commit is contained in:
Anna Kozlova
2013-12-09 21:20:01 +04:00
parent f74cd44e78
commit 8072d235ef
2 changed files with 12 additions and 1 deletions
@@ -66,7 +66,7 @@ public class ProblematicVarargsMethodOverrideInspection extends BaseInspection {
}
final PsiParameter parameter = parameters[parameters.length - 1];
final PsiType type = parameter.getType();
if (!(type instanceof PsiArrayType)) {
if (!(type instanceof PsiArrayType) || type instanceof PsiEllipsisType) {
return;
}
final PsiMethod[] superMethods = method.findDeepestSuperMethods();
@@ -34,6 +34,17 @@ public class ProblematicVarargsMethodOverrideInspectionTest extends LightInspect
"}");
}
public void testVarargsOverriding() {
doTest("class One {" +
" void m(String... ss) {" +
" }" +
"}" +
"class Two extends One {" +
" void m(String... ss) {" +
" }" +
"}");
}
@Override
protected InspectionProfileEntry getInspection() {
return new ProblematicVarargsMethodOverrideInspection();