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/JavaAddElementFromHistory.java
TextEdit edit= null;
			if (input != null)
				edit= new MemberEdit(input, MemberEdit.INSERT_AFTER, lines,
										CodeFormatterPreferencePage.getTabSize());
			else
				edit= createEdit(lines, parent);
			if (edit == null) {
				MessageDialog.openError(shell, errorTitle, "couldn't determine place to insert");
				return;
			}
			
			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);
		}
	}
	
	/**
	 * Creates a TextEdit for inserting the given lines into the container. 
	 */