void (@NotNull GrExpression selectedExpr) { // Cannot perform refactoring in parameter default values PsiElement parent = selectedExpr.getParent(); while (!(parent == null || parent instanceof GroovyFileBase || parent instanceof GrParameter)) { parent = parent.getParent(); } if (checkInFieldInitializer(selectedExpr)) { throw new GrRefactoringError(GroovyRefactoringBundle.message("refactoring.is.not.supported.in.the.current.context")); } if (parent instanceof GrParameter) { throw new GrRefactoringError(GroovyRefactoringBundle.message("refactoring.is.not.supported.in.method.parameters")); } }