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/JavaCompareWithEditionAction.java
states= file.getHistory(null);
		} catch (CoreException ex) {
			JavaPlugin.log(ex);
		}
		
		if (states != null)
			numberOfEditions += states.length;
			
		ITypedElement[] editions= new ITypedElement[numberOfEditions];
		editions[0]= new ResourceNode(file);
		if (states != null)		
			for (int i= 0; i < states.length; i++)
				editions[i+1]= new HistoryItem(editions[0], states[i]);
						
		
		TextBuffer buffer= null;
		try {
			buffer= TextBuffer.acquire(file);
			ResourceBundle bundle= ResourceBundle.getBundle(BUNDLE_NAME);
			EditionSelectionDialog d= new CompareWithEditionDialog(shell, bundle);
			
			ITypedElement ti= d.selectEdition(new JavaTextBufferNode(buffer, cu.getElementName()), editions, input);
						
			if (ti instanceof IStreamContentAccessor) {
				IStreamContentAccessor sca= (IStreamContentAccessor) ti;				
										
				
				String[] lines= null;
				try {
					lines= JavaCompareUtilities.readLines(((IStreamContentAccessor) ti).getContents());