Bug 80784 NPE in TestHierarchyTab.cacheItems [JUnit]
I20041208 + plug-in export java.lang.NullPointerException at org.eclipse.jdt.internal.junit.ui.TestHierarchyTab.cacheItems(TestHierarchyTab.java:296) at org.eclipse.jdt.internal.junit.ui.TestHierarchyTab.endTest(TestHierarchyTab.java:287) at org.eclipse.jdt.internal.junit.ui.TestRunnerViewPart$6.run(TestRunnerViewPart.java:974) at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:150) at org.eclipse.ui.internal.UISynchronizer$1.run(UISynchronizer.java:36) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:118) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2780) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2451) at org.eclipse.jface.window.Window.runEventLoop(Window.java:718) at org.eclipse.jface.window.Window.open(Window.java:696) at org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant$WorkspaceChangeSetCapability.createChangeSet(WorkspaceSynchronizeParticipant.java:135) at org.eclipse.team.internal.ui.synchronize.actions.ChangeSetActionGroup.createChangeSet(ChangeSetActionGroup.java:424) at org.eclipse.team.internal.ui.synchronize.actions.ChangeSetActionGroup.access$0(ChangeSetActionGroup.java:423) at org.eclipse.team.internal.ui.synchronize.actions.ChangeSetActionGroup$2.run(ChangeSetActionGroup.java:82) at org.eclipse.team.internal.ui.synchronize.actions.ChangeSetActionGroup$5.run(ChangeSetActionGroup.java:408) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:118) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2780) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2451) at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:141) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:279) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:447) at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:263) at org.eclipse.ui.internal.progress.ProgressManager$3.run(ProgressManager.java:840) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:874) at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:850) at org.eclipse.team.internal.ui.actions.ProgressDialogRunnableContext$1.run(ProgressDialogRunnableContext.java:107) at org.eclipse.team.internal.ui.actions.ProgressDialogRunnableContext.run(ProgressDialogRunnableContext.java:98) at org.eclipse.team.ui.TeamOperation.run(TeamOperation.java:159) at org.eclipse.team.ui.synchronize.SynchronizeModelAction.run(SynchronizeModelAction.java:96) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:555) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:505) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:419) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:814) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2803) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2448) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1578) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1549) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:281) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:220) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129) 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:185) at org.eclipse.core.launcher.Main.run(Main.java:684) at org.eclipse.core.launcher.Main.main(Main.java:668)
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestHierarchyTab.java
if (!fMoveSelection) {
			fMoveSelection= true;
			if (isLeafFailure(selection)) {
				selectTest(selection);
				return false;
			}
		}
		return true;
	}
	private TreeItem getInitialSearchSelection() {
		TreeItem[] treeItems= fTree.getSelection();	
		TreeItem selection= null;
		
		if (treeItems.length == 0)	
			selection= fTree.getItems()[0];
		else
			selection= treeItems[0];
		return selection;
	}
	private boolean isFailure(TreeItem selection) {
		return !(getTestRunInfo(selection).getStatus() == ITestRunListener.STATUS_OK);
	}
	private boolean isLeafFailure(TreeItem selection) {
		boolean isLeaf= selection.getItemCount() == 0;
		return isLeaf && isFailure(selection);
	}
	private void selectTest(TreeItem selection) {
		fTestRunnerPart.showTest(getTestRunInfo(selection));
	}
	private TreeItem findFailure(TreeItem start, boolean next, boolean includeNode) {