Bug 217096 [Markers] NPE from new problems view on startup
I20080122-1600 Started eclipse and got the following error: org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException) at org.eclipse.swt.SWT.error(SWT.java:3716) at org.eclipse.swt.SWT.error(SWT.java:3634) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3735) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3372) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2392) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2356) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2222) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:474) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:469) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:362) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:564) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1251) Caused by: java.lang.NullPointerException at org.eclipse.ui.internal.views.markers.ExtendedMarkersView.getCategoriesToExpand(ExtendedMarkersView.java:1506) at org.eclipse.ui.internal.views.markers.ExtendedMarkersView.access$4(ExtendedMarkersView.java:1497) at org.eclipse.ui.internal.views.markers.ExtendedMarkersView$11.runInUIThread(ExtendedMarkersView.java:1039) at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:130) ... 22 more Steps: no exact steps to reproduce, although the problems view was open when I started eclipse.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/ExtendedMarkersView.java
for (int i = 0; i < markerCategories.length; i++) {
						for (int j = 0; j < mementoCategories.length; j++) {
							if (markerCategories[i].getName().equals(
									mementoCategories[j].getID()))
								categoriesToExpand.add(markerCategories[i]
										.getName());
						}
					}
				}
			}
		}
		return categoriesToExpand;
	}
	/**
	 * Restore the expanded categories.
	 * @param builder
	 */
	void reexpandCategories(final CachedMarkerBuilder builder) {
		if (!getCategoriesToExpand().isEmpty()
				&& builder.isShowingHierarchy()) {
			MarkerItem[] items = builder.getElements();
			for (int i = 0; i < items.length; i++) {
				String name = ((MarkerCategory) items[i]).getName();
				if (getCategoriesToExpand().contains(name))
					viewer.expandToLevel(items[i], 2);
			}
		}
	}
}