mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
change signature: remove @Override if only overrider was changed (IDEA-154669)
This commit is contained in:
+7
@@ -770,6 +770,13 @@ public class JavaChangeSignatureUsageProcessor implements ChangeSignatureUsagePr
|
||||
final PsiClassType[] newExceptions = getPrimaryChangedExceptionInfo(changeInfo);
|
||||
fixPrimaryThrowsLists(method, newExceptions);
|
||||
}
|
||||
|
||||
if (baseMethod == null && method.findSuperMethods().length == 0) {
|
||||
final PsiAnnotation annotation = AnnotationUtil.findAnnotation(method, true, Override.class.getName());
|
||||
if (annotation != null) {
|
||||
annotation.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int processMethodParams(JavaChangeInfo changeInfo,
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
public void <caret>foo(int i) {}
|
||||
}
|
||||
class Test extends A {
|
||||
@Override
|
||||
public void foo(int i) {}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
public void <caret>foo() {}
|
||||
}
|
||||
class Test extends A {
|
||||
@Override
|
||||
public void foo() {}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class A {
|
||||
public void foo(int i) {}
|
||||
}
|
||||
class Test extends A {
|
||||
@Override
|
||||
public void <caret>foo(int i) {}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class A {
|
||||
public void foo(int i) {}
|
||||
}
|
||||
class Test extends A {
|
||||
public void <caret>foo() {}
|
||||
}
|
||||
@@ -376,6 +376,14 @@ public class ChangeSignatureTest extends ChangeSignatureBaseTest {
|
||||
doTest(null, null, "Exception", new SimpleParameterGen(), new SimpleExceptionsGen(), false);
|
||||
}
|
||||
|
||||
public void testRemoveOverride() {
|
||||
doTest(null, null, null, new ParameterInfoImpl[0], new ThrownExceptionInfo[0], false);
|
||||
}
|
||||
|
||||
public void testPreserveOverride() {
|
||||
doTest(null, null, null, new ParameterInfoImpl[0], new ThrownExceptionInfo[0], false);
|
||||
}
|
||||
|
||||
public void testVisibilityOfOverriddenMethod() {
|
||||
doTest(PsiModifier.PACKAGE_LOCAL, "foo", "void", new ParameterInfoImpl[0], new ThrownExceptionInfo[0], false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user