pm.beginTask("", 4);
pm.beginTask("", 3);
	private RefactoringStatus checkSelection(IProgressMonitor pm) throws JavaModelException {		try {			pm.beginTask("", 4); //$NON-NLS-1$			Expression selectedExpression= getSelectedExpression();			if (selectedExpression == null) {				String message= RefactoringCoreMessages.getString("ExtractConstantRefactoring.select_expression"); //$NON-NLS-1$				return CodeRefactoringUtil.checkMethodSyntaxErrors(fSelectionStart, fSelectionLength, fCompilationUnitNode, fCu, message);			}			pm.worked(1);			if (selectedExpression.getStartPosition() != fSelectionStart) {				int length= selectedExpression.getStartPosition() - fSelectionStart;				if (length >= 0 && !"".equals(fCu.getBuffer().getText(fSelectionStart, length).trim())) //$NON-NLS-1$					return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.getString("ExtractConstantRefactoring.begining")); //$NON-NLS-1$			}			pm.worked(1);			if (selectedExpression instanceof Name && selectedExpression.getParent() instanceof ClassInstanceCreation)				return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.getString("ExtractConstantRefactoring.name_in_new")); //$NON-NLS-1$			pm.worked(1);			RefactoringStatus result= new RefactoringStatus();			result.merge(checkExpression());			if (result.hasFatalError())				return result;			pm.worked(1);			return result;		} finally {			pm.done();		}	}