@Override
protected RefactoringStatus doCheckFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException, OperationCanceledException {
pm.beginTask("", 1); //$NON-NLS-1$
try {
RefactoringStatus result;
result = checkNewElementName(getNewElementName());
if (result.hasFatalError()) return result;
result = renameDeclaration(pm);
if (result.hasFatalError()) return result;
if (updateReferences) {
result = updateReferences(pm);
if (result.hasFatalError()) return result;
}
return result;
} finally {
pm.done();