extract super: ensure moved members order (IDEA-192850)

This commit is contained in:
Anna Kozlova
2018-05-29 20:54:23 +03:00
parent 66b397dd3d
commit e5604d0b21
5 changed files with 13 additions and 9 deletions
@@ -161,8 +161,8 @@ public class PullUpProcessor extends BaseRefactoringProcessor implements PullUpD
}
public void moveMembersToBase() throws IncorrectOperationException {
myMovedMembers = ContainerUtil.newHashSet();
myMembersAfterMove = ContainerUtil.newHashSet();
myMovedMembers = ContainerUtil.newLinkedHashSet();
myMembersAfterMove = ContainerUtil.newLinkedHashSet();
// build aux sets
for (MemberInfo info : myMembersToMove) {
@@ -1,7 +1,9 @@
public class Test {
int a;
int b;
public Test(int a) {
public Test(int a, int b) {
this.a = a;
this.b = b;
}
}
@@ -1,7 +1,7 @@
public class TestSubclass extends Test {
int b;
public TestSubclass(int a, int b) {
super(a);
this.b = b;
int c;
public TestSubclass(int a, int b, int c) {
super(a, b);
this.c = c;
}
}
@@ -1,8 +1,10 @@
public class Test {
int a;
int b;
public Test(int a, int b) {
int c;
public Test(int a, int b, int c) {
this.a = a;
this.b = b;
this.c = c;
}
}
@@ -95,7 +95,7 @@ public class ExtractSuperClassTest extends RefactoringTestCase {
}
public void testParameterNameEqualsFieldName() throws Exception { // IDEADEV-10629
doTest("Test", "TestSubclass", new RefactoringTestUtil.MemberDescriptor("a", PsiField.class));
doTest("Test", "TestSubclass", new RefactoringTestUtil.MemberDescriptor("a", PsiField.class), new RefactoringTestUtil.MemberDescriptor("b", PsiField.class));
}
public void testSameTypeParameterName() throws Exception {