Project: JDT
Bug 161414 [package explorer] NPE from Packages Explorer on restart
Reported: 2006-10-18 10:17:23 | Status: resolved fixed

I got the following NPE in the Packages Explorer after a restart: java.lang.NullPointerException at org.eclipse.jdt.internal.ui.packageview.WorkingSetAwareContentProvider.getWorkingSetChildren(WorkingSetAwareContentProvider.java:109) at org.eclipse.jdt.internal.ui.packageview.WorkingSetAwareContentProvider.getChildren(WorkingSetAwareContentProvider.java:85) at org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren(AbstractTreeViewer.java:1214) at org.eclipse.jface.viewers.TreeViewer.getRawChildren(TreeViewer.java:658) at org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer.isExpandable(ProblemTreeViewer.java:170) at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:1978) at org.eclipse.jface.viewers.AbstractTreeViewer.updatePlus(AbstractTreeViewer.java:2574) at org.eclipse.jface.viewers.TreeViewer.updatePlus(TreeViewer.java:983) at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:798) at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:775) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:749) at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:779) at org.eclipse.jface.viewers.AbstractTreeViewer.internalInitializeTree(AbstractTreeViewer.java:1352) at org.eclipse.jface.viewers.TreeViewer.internalInitializeTree(TreeViewer.java:963) at org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractTreeViewer.java:1339) at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1326) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$PackageExplorerProblemTreeViewer.preservingSelection(PackageExplorerPart.java:401) at org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(AbstractTreeViewer.java:1328) at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:250) at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1564) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.createPartControl(PackageExplorerPart.java:636) at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:332) at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:197) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:290) at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:525) at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:140) at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268) at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65) at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:394) at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1147) at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:623) at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:535) at org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:569) at org.eclipse.ui.internal.PerspectiveHelper.activate(PerspectiveHelper.java:244) at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:983) at org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPage.java:2412) at org.eclipse.ui.internal.WorkbenchWindow$6.run(WorkbenchWindow.java:2613) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow.java:2594) at org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:1979) at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.java:2859) at org.eclipse.ui.internal.Workbench.access$14(Workbench.java:2807) at org.eclipse.ui.internal.Workbench$19.run(Workbench.java:1683) at org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:1423) at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1681) at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1652) at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1531) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1475) at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(WorkbenchConfigurer.java:183) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:702) at org.eclipse.ui.internal.Workbench.init(Workbench.java:1087) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1849) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:348) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:341) at org.eclipse.core.launcher.Main.basicRun(Main.java:285) at org.eclipse.core.launcher.Main.run(Main.java:987) at org.eclipse.core.launcher.Main.main(Main.java:962)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/WorkingSetAwareContentProvider.java