Bug 24255 Internal error when invoking "Restore from Local History" in Outline view
smoke for 20021001 1. Open TestCase.java 2. Select the method at the end of the Outline view 3. From context menu select "Delete" 4. Now you must be fast: in the dialog press "Yes", go to the previously selected method, open the context menu and select "Restore from Local History..."
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
/**
	 * Creates a TextEdit for inserting the given lines into the container. 
	 */
	private MemberEdit createEdit(String[] lines, IParent container) {
		
		
		IJavaElement[] children= null;
		try {
			children= container.getChildren();
		} catch(JavaModelException ex) {
		}
		
		if (children != null) {
			IJavaElement candidate= null;
			for (int i= 0; i < children.length; i++) {
				IJavaElement chld= children[i];
				
				switch (chld.getElementType()) {
				case IJavaElement.PACKAGE_DECLARATION:
				case IJavaElement.IMPORT_CONTAINER:
					
					candidate= chld;
					continue;
				default:
					return new MemberEdit(chld, MemberEdit.INSERT_BEFORE, lines, JavaCompareUtilities.getTabSize());
				}
			}
			if (candidate != null)
				return new MemberEdit(candidate, MemberEdit.INSERT_AFTER, lines, JavaCompareUtilities.getTabSize());
		}