mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-38845 - CCE: AnonymousToInnerHandler.createClass
forbid to convert to inner enum constants
This commit is contained in:
+5
@@ -76,6 +76,11 @@ public class AnonymousToInnerHandler implements RefactoringActionHandler {
|
||||
showErrorMessage(editor, RefactoringBundle.getCannotRefactorMessage(RefactoringBundle.message("error.wrong.caret.position.anonymous")));
|
||||
return;
|
||||
}
|
||||
final PsiElement parent = anonymousClass.getParent();
|
||||
if (parent instanceof PsiEnumConstant) {
|
||||
showErrorMessage(editor, RefactoringBundle.getCannotRefactorMessage("Enum constant can't be converted to inner class"));
|
||||
return;
|
||||
}
|
||||
invoke(project, editor, anonymousClass);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user