mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
push down: fix extends/implements chooser (IDEA-190409)
This commit is contained in:
+1
-2
@@ -41,7 +41,6 @@ import com.intellij.refactoring.util.DocCommentPolicy;
|
||||
import com.intellij.refactoring.util.RefactoringUtil;
|
||||
import com.intellij.refactoring.util.classMembers.MemberInfo;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import java.util.HashSet;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -291,7 +290,7 @@ public class JavaPushDownDelegate extends PushDownDelegate<MemberInfo, PsiMember
|
||||
}
|
||||
}
|
||||
PsiJavaCodeReferenceElement classRef = classType != null ? factory.createReferenceElementByType(classType) : factory.createClassReferenceElement(psiClass);
|
||||
if (psiClass.isInterface()) {
|
||||
if (psiClass.isInterface() && !targetClass.isInterface()) {
|
||||
targetClass.getImplementsList().add(classRef);
|
||||
} else {
|
||||
targetClass.getExtendsList().add(classRef);
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
interface A {}
|
||||
|
||||
interface Test extends A { }
|
||||
|
||||
interface B extends Test { }
|
||||
@@ -0,0 +1,5 @@
|
||||
interface A {}
|
||||
|
||||
interface Test extends A { }
|
||||
|
||||
interface B extends Test, A { }
|
||||
@@ -58,6 +58,7 @@ public class PushDownTest extends LightRefactoringTestCase {
|
||||
public void testOverridingMethodWithSubst() { doTest(); }
|
||||
public void testSameClassInterface() { doTestImplements(); }
|
||||
public void testPreserveTypeArgs() { doTestImplements(); }
|
||||
public void testInterfaceExtends() { doTestImplements(); }
|
||||
public void testSubstTypeArgs() { doTestImplements(); }
|
||||
public void testExtensionMethodToInterface() { doTest(); }
|
||||
public void testExtensionMethodToClass() { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user