boolean (PsiClass parentClass, PsiExpression selectedExpr, Editor editor) { if (parentClass.isInterface()) { String message = RefactoringBundle.getCannotRefactorMessage(JavaRefactoringBundle.message("cannot.introduce.field.in.interface")); CommonRefactoringUtil.showErrorHint(parentClass.getProject(), editor, message, getRefactoringNameText(), getHelpID()); return false; } else if (parentClass.isRecord()) { final PsiModifierListOwner staticParentElement = PsiUtil.getEnclosingStaticElement(selectedExpr, parentClass); boolean declareStatic = staticParentElement != null; if (declareStatic) return true; String message = RefactoringBundle.getCannotRefactorMessage(JavaRefactoringBundle.message("cannot.introduce.field.in.record")); CommonRefactoringUtil.showErrorHint(parentClass.getProject(), editor, message, getRefactoringNameText(), getHelpID()); return false; } return true; }