mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
pull up/push down: type parameters substitution should modify member copy (IDEA-53496)
This commit is contained in:
@@ -161,6 +161,14 @@ public class InlineSuperClassTest extends MultiFileTestCase {
|
||||
}
|
||||
|
||||
public void testMultipleSubclasses() throws Exception {
|
||||
doTestMultipleSubclasses();
|
||||
}
|
||||
|
||||
public void testMultipleSubstitutions() throws Exception {
|
||||
doTestMultipleSubclasses();
|
||||
}
|
||||
|
||||
private void doTestMultipleSubclasses() throws Exception {
|
||||
doTest(new PerformAction() {
|
||||
public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
|
||||
PsiClass superClass = myJavaFacade.findClass("Super", GlobalSearchScope.allScope(myProject));
|
||||
|
||||
@@ -79,7 +79,19 @@ public class PullUpTest extends LightCodeInsightTestCase {
|
||||
doTest(new MemberDescriptor("f", PsiField.class));
|
||||
}
|
||||
|
||||
public void testGenericsInAbstractMethod() throws Exception {
|
||||
doTest(new MemberDescriptor("method", PsiMethod.class, true));
|
||||
}
|
||||
|
||||
public void testGenericsInImplements() throws Exception {
|
||||
doTest(false, new MemberDescriptor("I", PsiClass.class));
|
||||
}
|
||||
|
||||
private void doTest(MemberDescriptor... membersToFind) throws Exception {
|
||||
doTest(true, membersToFind);
|
||||
}
|
||||
|
||||
private void doTest(final boolean checkMemebersMovedCount, MemberDescriptor... membersToFind) throws Exception {
|
||||
configureByFile(BASE_PATH + getTestName(false) + ".java");
|
||||
PsiElement elementAt = getFile().findElementAt(getEditor().getCaretModel().getOffset());
|
||||
final PsiClass sourceClass = PsiTreeUtil.getParentOfType(elementAt, PsiClass.class);
|
||||
@@ -105,7 +117,9 @@ public class PullUpTest extends LightCodeInsightTestCase {
|
||||
final PullUpHelper helper = new PullUpHelper(sourceClass, targetClass, infos, new DocCommentPolicy(DocCommentPolicy.ASIS));
|
||||
helper.run();
|
||||
JavaRefactoringListenerManager.getInstance(getProject()).removeMoveMembersListener(listener);
|
||||
assertEquals(countMoved[0], membersToFind.length);
|
||||
if (checkMemebersMovedCount) {
|
||||
assertEquals(countMoved[0], membersToFind.length);
|
||||
}
|
||||
checkResultByFile(BASE_PATH + getTestName(false) + "_after.java");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user