Bug 17271 Not present exception renaming class in java browsing perspective
Build 20020521 (running with java delta tracing) 1. Create the following CU: public class HelloWorld { } 2. Open Java Browsing perspective 3. Open HelloWorld 4. In java editor, rename HelloWorld to Hellorld2 5. Save Observe the following in the console: UPDATING Model with Delta: [Thread[main,5,main]:HelloWorld.java[*]: {CHILDREN | FINE GRAINED} HelloWorld2[+]: {} HelloWorld[-]: {}]: FIRING PRE_AUTO_BUILD Delta [Thread[main,5,main]]: HelloWorld.java[*]: {CHILDREN | FINE GRAINED} HelloWorld2[+]: {} HelloWorld[-]: {} MERGING 2 DELTAS [Thread[main,5,main]] HelloWorld.java[*]: {CHILDREN | FINE GRAINED} HelloWorld2[+]: {} HelloWorld[-]: {} Java Model[*]: {CHILDREN} Test[*]: {CHILDREN} [project root][*]: {CHILDREN} [default][*]: {CHILDREN} HelloWorld.java[*]: {CONTENT} FIRING POST_CHANGE Delta [Thread[main,5,main]]: Java Model[*]: {CHILDREN} Test[*]: {CHILDREN} [project root][*]: {CHILDREN} [default][*]: {CHILDREN} HelloWorld.java[*]: {CHILDREN | FINE GRAINED} HelloWorld2[+]: {} HelloWorld[-]: {} !ENTRY org.eclipse.jdt.ui 4 1 May 23, 2002 16:01:58.72 !MESSAGE Internal Error !STACK 1 Java Model Exception: Java Model Status [HelloWorld does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:501) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:530) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:309) at org.eclipse.jdt.internal.core.JavaElement.getChildren (JavaElement.java:266) at org.eclipse.jdt.internal.core.JavaElement.getChildrenOfType (JavaElement.java:275) at org.eclipse.jdt.internal.core.SourceType.getFields (SourceType.java:178) at org.eclipse.jdt.ui.actions.AddGetterSetterAction.canEnableOn (AddGetterSetterAction.java:168) at org.eclipse.jdt.ui.actions.AddGetterSetterAction.canEnable (AddGetterSetterAction.java:157) at org.eclipse.jdt.ui.actions.AddGetterSetterAction.selectionChanged (AddGetterSetterAction.java:123) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchSelectionChanged (SelectionDispatchAction.java:168) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.selectionChanged (SelectionDispatchAction.java:163) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged (Viewer.java:147) at org.eclipse.jface.viewers.StructuredViewer.updateSelection (StructuredViewer.java:1154) at org.eclipse.jface.viewers.StructuredViewer.handleSelect (StructuredViewer.java:544) at org.eclipse.jface.viewers.StructuredViewer$1.widgetSelected (StructuredViewer.java:568) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent (OpenStrategy.java:171) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:168) at org.eclipse.jface.util.OpenStrategy$1.handleEvent (OpenStrategy.java:297) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1527) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1289) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1085) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1068) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:739) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24) !ENTRY org.eclipse.jdt.core 4 969 May 23, 2002 16:01:58.72 !MESSAGE HelloWorld does not exist. !ENTRY org.eclipse.jdt.ui 4 1 May 23, 2002 16:01:58.102 !MESSAGE An error occurred while accessing a Java element !STACK 1 Java Model Exception: Java Model Status [HelloWorld does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:501) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:530) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:309) at org.eclipse.jdt.internal.core.SourceType.isInterface (SourceType.java:320) at org.eclipse.jdt.ui.actions.FindImplementorsAction.canOperateOn (FindImplementorsAction.java:69) at org.eclipse.jdt.ui.actions.FindAction.canOperateOn (FindAction.java:91) at org.eclipse.jdt.ui.actions.FindAction.selectionChanged (FindAction.java:257) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchSelectionChanged (SelectionDispatchAction.java:168) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.selectionChanged (SelectionDispatchAction.java:163) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged (Viewer.java:147) at org.eclipse.jface.viewers.StructuredViewer.updateSelection (StructuredViewer.java:1154) at org.eclipse.jface.viewers.StructuredViewer.handleSelect (StructuredViewer.java:544) at org.eclipse.jface.viewers.StructuredViewer$1.widgetSelected (StructuredViewer.java:568) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent (OpenStrategy.java:171) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:168) at org.eclipse.jface.util.OpenStrategy$1.handleEvent (OpenStrategy.java:297) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1527) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1289) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1085) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1068) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:739) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24) !ENTRY org.eclipse.jdt.core 4 969 May 23, 2002 16:01:58.102 !MESSAGE HelloWorld does not exist. !ENTRY org.eclipse.jdt.ui 4 1 May 23, 2002 16:01:58.112 !MESSAGE An error occurred while accessing a Java element !STACK 1 Java Model Exception: Java Model Status [HelloWorld does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:501) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:530) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:309) at org.eclipse.jdt.internal.core.SourceType.isInterface (SourceType.java:320) at org.eclipse.jdt.ui.actions.FindImplementorsAction.canOperateOn (FindImplementorsAction.java:69) at org.eclipse.jdt.ui.actions.FindAction.canOperateOn (FindAction.java:91) at org.eclipse.jdt.ui.actions.FindAction.selectionChanged (FindAction.java:257) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchSelectionChanged (SelectionDispatchAction.java:168) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.selectionChanged (SelectionDispatchAction.java:163) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged (Viewer.java:147) at org.eclipse.jface.viewers.StructuredViewer.updateSelection (StructuredViewer.java:1154) at org.eclipse.jface.viewers.StructuredViewer.handleSelect (StructuredViewer.java:544) at org.eclipse.jface.viewers.StructuredViewer$1.widgetSelected (StructuredViewer.java:568) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent (OpenStrategy.java:171) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:168) at org.eclipse.jface.util.OpenStrategy$1.handleEvent (OpenStrategy.java:297) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:825) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1527) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1289) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1085) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1068) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:739) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:432) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24) !ENTRY org.eclipse.jdt.core 4 969 May 23, 2002 16:01:58.112 !MESSAGE HelloWorld does not exist.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingContentProvider.java
if (element instanceof Collection) {
				Collection elements= (Collection)element;
				if (elements.isEmpty())
					return NO_CHILDREN;
				Object[] result= new Object[0];
				Iterator iter= ((Collection)element).iterator();
				while (iter.hasNext()) {
					Object[] children= getChildren(iter.next());
					if (children != NO_CHILDREN)
						result= concatenate(result, children);
				}
				return result;
			}
			if (element instanceof IPackageFragment) 
				return getPackageContents((IPackageFragment)element);
			if (fProvideMembers && element instanceof IType)
				return getChildren((IType)element);
			if (fProvideMembers && element instanceof ISourceReference && element instanceof IParent)
				return removeImportAndPackageDeclarations(super.getChildren(element));
			if (element instanceof IJavaProject) 
				return getPackageFragmentRoots((IJavaProject)element);
			return super.getChildren(element);
		} catch (JavaModelException e) {
			return NO_CHILDREN;
		}		
	}
	private Object[] getPackageContents(IPackageFragment fragment) throws JavaModelException {
		ISourceReference[] sourceRefs;
		if (fragment.getKind() == IPackageFragmentRoot.K_SOURCE) {
			sourceRefs= fragment.getCompilationUnits();