mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-117894 Incorrect warning of 'non-varags methods overrides varargs method'
This commit is contained in:
+1
-1
@@ -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();
|
||||
|
||||
+11
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user