mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
push down: interface constants in class should appear with public-static-final (IDEA-123758)
This commit is contained in:
@@ -431,6 +431,11 @@ public class PushDownProcessor extends BaseRefactoringProcessor {
|
||||
PsiMember newMember = null;
|
||||
if (member instanceof PsiField) {
|
||||
((PsiField)member).normalizeDeclaration();
|
||||
if (myClass.isInterface() && !targetClass.isInterface()) {
|
||||
PsiUtil.setModifierProperty(member, PsiModifier.PUBLIC, true);
|
||||
PsiUtil.setModifierProperty(member, PsiModifier.STATIC, true);
|
||||
PsiUtil.setModifierProperty(member, PsiModifier.FINAL, true);
|
||||
}
|
||||
newMember = (PsiMember)targetClass.add(member);
|
||||
}
|
||||
else if (member instanceof PsiMethod) {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
interface SimpleDialogPresenter {
|
||||
int BUT<caret>TON_POSITIVE = 1;
|
||||
int BUTTON_NEGATIVE = 2;
|
||||
int BUTTON_NEUTRAL = 3;
|
||||
}
|
||||
|
||||
class SimpleDialogPresenterImpl implements SimpleDialogPresenter {}
|
||||
@@ -0,0 +1,8 @@
|
||||
interface SimpleDialogPresenter {
|
||||
int BUTTON_NEGATIVE = 2;
|
||||
int BUTTON_NEUTRAL = 3;
|
||||
}
|
||||
|
||||
class SimpleDialogPresenterImpl implements SimpleDialogPresenter {
|
||||
public static final int BUTTON_POSITIVE = 1;
|
||||
}
|
||||
@@ -60,6 +60,8 @@ public class PushDownTest extends LightRefactoringTestCase {
|
||||
public void testFunctionalInterface() { doTest(true);}
|
||||
public void testFunctionalExpressionDefaultMethod() { doTest();}
|
||||
|
||||
public void testInterfaceConstants() { doTest();}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user