@Override public RefactoringStatus checkNewName(String newName) { RefactoringStatus result = new RefactoringStatus(); result.merge(super.checkNewName(newName)); if (element instanceof LocalVariableElement) { LocalVariableElement variableElement = (LocalVariableElement) element; if (variableElement.isConst()) { result.merge(NamingConventions.validateConstantName(newName)); } else { result.merge(NamingConventions.validateVariableName(newName)); } } else if (element instanceof ParameterElement) { result.merge(NamingConventions.validateParameterName(newName)); } else if (element instanceof FunctionElement) { result.merge(NamingConventions.validateFunctionName(newName)); } return result; }
@Override public RefactoringStatus checkFinalConditions(ProgressMonitor pm) throws Exception { pm = checkProgressMonitor(pm); pm.beginTask("Checking final conditions", 1); try { RefactoringStatus result = new RefactoringStatus(); result.merge(analyzePossibleConflicts(new SubProgressMonitor(pm, 1))); return result; } finally { pm.done(); } }