Bug 59229 AssertionFailed when restoring from local history
smoke for I20040420 1. open SimpleTest.java 2. select all in editor 3. delete 4. save 5. select SimpleTest.java in Package Explorer 6. context menu > Restore From Local Histore... 7. select all elements 8. click Restore ==> nothing restores and Assertion failure (see below) I looks as if restoring CU children always fails. Restoring elements for types works. org.eclipse.jface.util.Assert$AssertionFailedException: Assertion failed: at org.eclipse.jface.util.Assert.isTrue(Assert.java:168) at org.eclipse.jface.util.Assert.isTrue(Assert.java:154) at org.eclipse.jdt.internal.ui.compare.JavaAddElementFromHistory.getPlaceHolderType(JavaAddElementFromHistory.java:267) at org.eclipse.jdt.internal.ui.compare.JavaAddElementFromHistory.createASTNode(JavaAddElementFromHistory.java:204) at org.eclipse.jdt.internal.ui.compare.JavaAddElementFromHistory.run(JavaAddElementFromHistory.java:157) at org.eclipse.jdt.internal.ui.compare.JavaHistoryAction.run(JavaHistoryAction.java:361) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:269) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:550) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:502) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:435) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:769) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2592) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2270) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1437) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1408) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:244) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:140) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:90) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:280) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:240) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:267) at org.eclipse.core.launcher.Main.run(Main.java:699) at org.eclipse.core.launcher.Main.main(Main.java:683)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
return;
		}
		
		IFile file= getFile(parent);
		if (file == null) {
			MessageDialog.openError(shell, errorTitle, errorMessage);
			return;
		}
				
		boolean inEditor= beingEdited(file);
		if (inEditor) {
			parent= (IParent) getWorkingCopy((IJavaElement)parent);
			if (input != null)
				input= (IMember) getWorkingCopy(input);
		}
		
		TextBuffer buffer= null;
		try {
			buffer= TextBuffer.acquire(file);
		
			if (! buffer.makeCommittable(shell).isOK())
				return;
			
			ITypedElement target= new JavaTextBufferNode(buffer, inEditor);
			ITypedElement[] editions= buildEditions(target, file);
											
			ResourceBundle bundle= ResourceBundle.getBundle(BUNDLE_NAME);
			EditionSelectionDialog d= new EditionSelectionDialog(shell, bundle);
			d.setAddMode(true);
			d.setHelpContextId(IJavaHelpContextIds.ADD_ELEMENT_FROM_HISTORY_DIALOG);