inline super: don't warn for unresolved constructor with new array (IDEA-152583)

This commit is contained in:
Anna Kozlova
2016-03-04 17:00:37 +01:00
parent 8ff49ddc39
commit 84f7bc13b8
4 changed files with 15 additions and 3 deletions
@@ -38,8 +38,10 @@ public class ReplaceConstructorUsageInfo extends FixableUsageInfo{
final PsiMethod[] constructors = targetClasses[0].getConstructors();
final PsiMethod constructor = element.resolveConstructor();
if (constructor == null) {
if (constructors.length == 1 && constructors[0].getParameterList().getParametersCount() > 0 || constructors.length > 1) {
myConflict = CONSTRUCTOR_MATCHING_SUPER_NOT_FOUND;
if (element.getArgumentList() != null) {
if (constructors.length == 1 && constructors[0].getParameterList().getParametersCount() > 0 || constructors.length > 1) {
myConflict = CONSTRUCTOR_MATCHING_SUPER_NOT_FOUND;
}
}
} else {
final PsiParameter[] superParameters = constructor.getParameterList().getParameters();
@@ -1,4 +1,7 @@
class Test {
public Test() {
}
public static Test[] getArray() {
return new Test[0];
}
@@ -1,4 +1,7 @@
class Super {
public Super(String s) {
}
public static Super[] getArray() {
return new Super[0];
}
@@ -1 +1,5 @@
class Test extends Super {}
class Test extends Super {
public Test() {
super("");
}
}