mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
move enum to inner: don't add static modifier (IDEA-185872)
This commit is contained in:
+1
-1
@@ -49,7 +49,7 @@ public class JavaMoveClassToInnerHandler implements MoveClassToInnerHandler {
|
||||
if (targetClass.isInterface()) {
|
||||
PsiUtil.setModifierProperty(newClass, PsiModifier.PACKAGE_LOCAL, true);
|
||||
}
|
||||
else {
|
||||
else if (!newClass.isEnum()) {
|
||||
PsiUtil.setModifierProperty(newClass, PsiModifier.STATIC, true);
|
||||
}
|
||||
return (PsiClass)ChangeContextUtil.decodeContextInfo(newClass, null, null);
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package pack1;
|
||||
|
||||
public class Class1 {
|
||||
public enum AEnum {
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package pack1;
|
||||
|
||||
public class Class1 {
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package pack2;
|
||||
|
||||
public enum AEnum {
|
||||
}
|
||||
@@ -52,6 +52,10 @@ public class MoveClassToInnerTest extends RefactoringTestCase {
|
||||
doTest(new String[] { "pack1.Class1" }, "pack2.A");
|
||||
}
|
||||
|
||||
public void testInnerEnum() throws Exception {
|
||||
doTest(new String[] { "pack2.AEnum" }, "pack1.Class1");
|
||||
}
|
||||
|
||||
public void testInnerInsideMoved() throws Exception {
|
||||
doTest(new String[] { "pack1.Class1" }, "pack2.A");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user