mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Java: don't add abstract modifier to interface methods when pulling up methods
GitOrigin-RevId: df0c5de380b00f2d42e073a15f4472d52cb34470
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3cd88edfd3
commit
f30035d655
@@ -383,7 +383,9 @@ public final class RefactoringUtil {
|
||||
body.delete();
|
||||
}
|
||||
|
||||
PsiUtil.setModifierProperty(method, PsiModifier.ABSTRACT, true);
|
||||
if (!targetClass.isInterface()) {
|
||||
PsiUtil.setModifierProperty(method, PsiModifier.ABSTRACT, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!targetClass.isInterface()) {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
interface Foo1 {
|
||||
void foo();
|
||||
}
|
||||
class Bar implements Foo1 {
|
||||
public void <caret>foo() {
|
||||
System.out.println("hello");
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
interface Foo1 {
|
||||
void foo();
|
||||
}
|
||||
class Bar implements Foo1 {
|
||||
@Override
|
||||
public void foo() {
|
||||
System.out.println("hello");
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,10 @@ public class PullUpTest extends LightRefactoringTestCase {
|
||||
doTest(new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class, true));
|
||||
}
|
||||
|
||||
public void testNoAbstractModifiersOnInterfaceMethods() {
|
||||
doTest(new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class, true));
|
||||
}
|
||||
|
||||
public void testQualifiedReference() { // IDEADEV-25008
|
||||
doTest(new RefactoringTestUtil.MemberDescriptor("x", PsiField.class),
|
||||
new RefactoringTestUtil.MemberDescriptor("getX", PsiMethod.class),
|
||||
|
||||
Reference in New Issue
Block a user