String (PsiExpression expr) { if (PsiImplUtil.getSwitchLabel(expr) != null) { PsiReferenceExpression ref = ObjectUtils.tryCast(PsiUtil.skipParenthesizedExprDown(expr), PsiReferenceExpression.class); if (ref != null && ref.resolve() instanceof PsiEnumConstant) { return RefactoringBundle.getCannotRefactorMessage( JavaRefactoringBundle.message("refactoring.introduce.variable.enum.in.label.message")); } } return null; }