Bug 4381 Replace from local histroy - workspace element included
- modify a CU in the workspace - select the CU - activate "Replace from local history" - the workspace element is included in the local histroy, but a histroy never includes the actual element. I was really suprised seeing the element.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaReplaceWithEditionAction.java
} catch (CoreException ex) {
					JavaPlugin.log(ex);
				}
				if (lines == null) {
					MessageDialog.openError(shell, errorTitle, "couldn't get text to insert");
					return;
				}
				
				TextEdit edit= new MemberEdit(input, MemberEdit.REPLACE, lines,
										CodeFormatterPreferencePage.getTabSize());
				TextBufferEditor editor= new TextBufferEditor(buffer);
				editor.addTextEdit(edit);
				editor.performEdits(new NullProgressMonitor());
				
				TextBuffer.commitChanges(buffer, false, new NullProgressMonitor());
			}
		} catch(CoreException ex) {
			JavaPlugin.log(ex);
			MessageDialog.openError(shell, errorTitle, "error with TextBuffer");
		} finally {
			if (buffer != null)
				TextBuffer.release(buffer);
		}
	}
	
	protected boolean isEnabled(ISelection selection) {
		return getEditionElement(selection) != null;
	}
}