mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
push down: normalize field before copy is created (IDEA-182422)
otherwise initial field bundle won't be updated
This commit is contained in:
+4
-1
@@ -204,11 +204,14 @@ public class JavaPushDownDelegate extends PushDownDelegate<MemberInfo, PsiMember
|
||||
refsToRebind.add(reference);
|
||||
}
|
||||
}
|
||||
if (member instanceof PsiField) {
|
||||
((PsiField)member).normalizeDeclaration();
|
||||
}
|
||||
|
||||
member = (PsiMember)member.copy();
|
||||
RefactoringUtil.replaceMovedMemberTypeParameters(member, PsiUtil.typeParametersIterable(sourceClass), substitutor, factory);
|
||||
PsiMember newMember = null;
|
||||
if (member instanceof PsiField) {
|
||||
((PsiField)member).normalizeDeclaration();
|
||||
if (sourceClass.isInterface() && !targetClass.isInterface()) {
|
||||
PsiUtil.setModifierProperty(member, PsiModifier.PUBLIC, true);
|
||||
PsiUtil.setModifierProperty(member, PsiModifier.STATIC, true);
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
class Base {
|
||||
int one, t<caret>wo;
|
||||
}
|
||||
class Inheritor extends Base {}
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
class Base {
|
||||
int one;
|
||||
}
|
||||
class Inheritor extends Base {
|
||||
int two;
|
||||
}
|
||||
@@ -42,6 +42,7 @@ public class PushDownTest extends LightRefactoringTestCase {
|
||||
public void testBodyTypeParameter() { doTest(); }
|
||||
public void testDisagreeTypeParameter() { doTest(true); }
|
||||
public void testFieldAndReferencedClass() { doTest(); }
|
||||
public void testSecondNormalizedField() { doTest(); }
|
||||
public void testFieldAndStaticReferencedClass() { doTest(); }
|
||||
public void testThisRefInAnonymous() { doTest(); }
|
||||
public void testSuperOverHierarchyConflict() { doTest(true); }
|
||||
|
||||
Reference in New Issue
Block a user