Bug 9099 Exception in hierarchy updating after deleting a project
1) create a workspace with JUnit open 2) open an editor so that the outline view is populated 3) delete JUnit JDT Core needs to handle this case more gracefully. You get the following JavaModelException Java Model Exception: Java Model Status [JUnit does not exist.] at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException (JavaElement.java:452) at org.eclipse.jdt.internal.core.JavaProject.openWhenClosed (JavaProject.java:1559) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:473) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:269) at org.eclipse.jdt.internal.core.JavaProject.getJavaProjectElementInfo (JavaProject.java:842) at org.eclipse.jdt.internal.core.JavaProject.getSearchableNameEnvironment (JavaProject.java:1319) at org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.<init> (HierarchyBuilder.java:61) at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.<init> (IndexBasedHierarchyBuilder.java:94) at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute (TypeHierarchy.java:246) at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh (TypeHierarchy.java:1094) at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.doHierarchyRefr esh(TypeHierarchyLifeCycle.java:163) at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.access$0 (TypeHierarchyLifeCycle.java:129) at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle$1.run (TypeHierarchyLifeCycle.java:105) at org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext$BusyRunnable.inter nalRun(BusyIndicatorRunnableContext.java:107) at org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext$BusyRunnable.run (BusyIndicatorRunnableContext.java:74) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:56) at org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext.run (BusyIndicatorRunnableContext.java:120) at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyLifeCycle.ensureRefreshed TypeHierarchy(TypeHierarchyLifeCycle.java:113) at org.eclipse.jdt.internal.ui.viewsupport.OverrideImageProvider.getTypeHierarchy (OverrideImageProvider.java:54) at org.eclipse.jdt.internal.ui.viewsupport.OverrideImageProvider.computeExtraAdornm entFlags(OverrideImageProvider.java:40) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.computeAdornmen tFlags(JavaElementImageProvider.java:270) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getJavaImageDes criptor(JavaElementImageProvider.java:115) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getImageLabel (JavaElementImageProvider.java:89) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getImage (JavaUILabelProvider.java:70) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlineErrorTickUpdater.updateItem (JavaOutlineErrorTickUpdater.java:104) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlineErrorTickUpdater.updateItem (JavaOutlineErrorTickUpdater.java:110) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlineErrorTickUpdater.doUpdateError Ticks(JavaOutlineErrorTickUpdater.java:95) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlineErrorTickUpdater.access$0 (JavaOutlineErrorTickUpdater.java:80) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlineErrorTickUpdater$1.run (JavaOutlineErrorTickUpdater.java:74) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:29) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages (Synchronizer.java:93) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:1390) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1208) at org.eclipse.jface.window.Window.runEventLoop(Window.java:545) at org.eclipse.jface.window.Window.open(Window.java:532) at org.eclipse.jface.dialogs.MessageDialog.openError (MessageDialog.java:318) at org.eclipse.ui.internal.Workbench.handleExceptionInEventLoop (Workbench.java:402) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:855) at org.eclipse.ui.internal.Workbench.run(Workbench.java:835) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:895) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:321) at SlimLauncher.main(SlimLauncher.java:14) 4 org.eclipse.jdt.core 969 JUnit does not exist.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/TypeHierarchyLifeCycle.java
}
	
	public void removeChangedListener(ITypeHierarchyLifeCycleListener listener) {
		fChangeListeners.remove(listener);
	}
	
	public void addChangedListener(ITypeHierarchyLifeCycleListener listener) {
		if (!fChangeListeners.contains(listener)) {
			fChangeListeners.add(listener);
		}
	}
	
	private void fireChange(IType[] changedTypes) {
		for (int i= fChangeListeners.size()-1; i>=0; i--) {
			ITypeHierarchyLifeCycleListener curr= (ITypeHierarchyLifeCycleListener) fChangeListeners.get(i);
			curr.typeHierarchyChanged(this, changedTypes);
		}
	}
		
	public void ensureRefreshedTypeHierarchy(final IJavaElement element) throws JavaModelException {
		if (element == null) {
			freeHierarchy();
			return;
		}
		boolean hierachyCreationNeeded= (fHierarchy == null || !element.equals(fInputElement));
		
		if (hierachyCreationNeeded || fHierarchyRefreshNeeded) {
			IRunnableWithProgress op= new IRunnableWithProgress() {
				public void run(IProgressMonitor pm) throws InvocationTargetException {
					try {