mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
change signature: call to super in class/field initializer
EA-93569 - IAE: MethodSignatureUtil.isSuperMethod
This commit is contained in:
+2
-2
@@ -280,7 +280,7 @@ public class JavaChangeSignatureUsageProcessor implements ChangeSignatureUsagePr
|
||||
boolean toInsertDefaultValue = needDefaultValue(changeInfo, caller);
|
||||
if (toInsertDefaultValue && ref instanceof PsiReferenceExpression) {
|
||||
final PsiExpression qualifierExpression = ((PsiReferenceExpression)ref).getQualifierExpression();
|
||||
if (qualifierExpression instanceof PsiSuperExpression && callerSignatureIsAboutToChangeToo(caller, usages)) {
|
||||
if (qualifierExpression instanceof PsiSuperExpression && caller != null && callerSignatureIsAboutToChangeToo(caller, usages)) {
|
||||
toInsertDefaultValue = false;
|
||||
}
|
||||
}
|
||||
@@ -300,7 +300,7 @@ public class JavaChangeSignatureUsageProcessor implements ChangeSignatureUsagePr
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean callerSignatureIsAboutToChangeToo(final PsiMethod caller, final UsageInfo[] usages) {
|
||||
private static boolean callerSignatureIsAboutToChangeToo(@NotNull final PsiMethod caller, final UsageInfo[] usages) {
|
||||
for (UsageInfo usage : usages) {
|
||||
if (usage instanceof MethodCallUsageInfo &&
|
||||
MethodSignatureUtil.isSuperMethod(((MethodCallUsageInfo)usage).getReferencedMethod(), caller)) {
|
||||
|
||||
+4
@@ -5,5 +5,9 @@ class Foo {
|
||||
void foo(){
|
||||
super.foo();
|
||||
}
|
||||
|
||||
{
|
||||
super.foo();
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
@@ -5,5 +5,9 @@ class Foo {
|
||||
void foo(int i){
|
||||
super.foo(i);
|
||||
}
|
||||
|
||||
{
|
||||
super.foo(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user