Bug 28244 Edit->Undo / Refactor->Undo don't play well together
reproducible in I20021210 with the following steps and code: - select "b + c" - extract local - edit->undo - refactor->undo public class Test { public Test() { int a= 1; int b= 2; int c= 3; int d= a + b + c; } }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ExtractMethodAction.java
ExceptionHandler.handle(e, fDialogMessageTitle, RefactoringMessages.getString("NewTextRefactoringAction.exception")); 
		} finally {
			if (target != null)
				target.endCompoundChange();
		}
	}
	/* (non-Javadoc)
	 * Method declared on SelectionDispatchAction
	 */		
	protected void selectionChanged(ITextSelection selection) {
		setEnabled(checkEnabled(selection));
	}
	
	private Refactoring createRefactoring(ICompilationUnit cunit, ITextSelection selection) throws JavaModelException {
		return new ExtractMethodRefactoring(
			cunit, 
			selection.getOffset(), selection.getLength(),
			JavaPreferencesSettings.getCodeGenerationSettings());
	}
	private RefactoringWizard createWizard(Refactoring refactoring) {
		return new ExtractMethodWizard((ExtractMethodRefactoring)refactoring);
	}
	
	private boolean checkEnabled(ITextSelection selection) {
		if (selection.getLength() == 0)
			return false;
		return fEditor != null && SelectionConverter.getInputAsCompilationUnit(fEditor) != null;
	}
}