Community
Participate
Working Groups
java.lang.NullPointerException at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:204) at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(SearchEngine.java:584) at org.eclipse.jdt.internal.corext.util.AllTypesCache.isIndexUpToDate(AllTypesCache.java:256) at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.restoreState(TypeHierarchyViewPart.java:1349) at org.eclipse.jdt.internal.ui.typehierarchy.TypeHierarchyViewPart.createPartControl(TypeHierarchyViewPart.java:777) at org.eclipse.ui.internal.PartPane$4.run(PartPane.java:138) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:867) at org.eclipse.core.runtime.Platform.run(Platform.java:413) at org.eclipse.ui.internal.PartPane.createChildControl(PartPane.java:134) at org.eclipse.ui.internal.ViewPane.createChildControl(ViewPane.java:202) at org.eclipse.ui.internal.ViewFactory$2.run(ViewFactory.java:161) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:867) at org.eclipse.core.runtime.Platform.run(Platform.java:413) at org.eclipse.ui.internal.ViewFactory.busyRestoreView(ViewFactory.java:92) at org.eclipse.ui.internal.ViewFactory$1.run(ViewFactory.java:76) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65) at org.eclipse.ui.internal.ViewFactory.restoreView(ViewFactory.java:72) at org.eclipse.ui.internal.ViewFactory$ViewReference.getPart(ViewFactory.java:326) at org.eclipse.ui.internal.WorkbenchPage$1.propertyChange(WorkbenchPage.java:121) at org.eclipse.ui.internal.LayoutPart.setVisible(LayoutPart.java:234) at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:345) at org.eclipse.ui.internal.PartTabFolder.setSelection(PartTabFolder.java:845) at org.eclipse.ui.internal.PartTabFolder.access$3(PartTabFolder.java:833) at org.eclipse.ui.internal.PartTabFolder$2.handleEvent(PartTabFolder.java:190) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:861) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:845) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:652) at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:1738) at org.eclipse.swt.custom.CTabFolder.onMouseDown(CTabFolder.java:1861) at org.eclipse.swt.custom.CTabFolder.access$4(CTabFolder.java:1853) at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:197) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:836) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1775) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1483) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1271) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1254) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539)
The line progress.setCanceled(true); is not checking that progress can be null.
If progress is null and the mode IJob.CancelIfNotReady is used, the call to setCanceled(boolean) should be protected and it should directly throw the OperationCanceledException.
Added null check, need to investigate some more about throwing an exception (unsure our internal clients are prepared for it).
Our internal clients don't use the CANCEL_IF_NOT_READY_TO_SEARCH waiting policy. Added a 'throw OperationCanceledException' statement to JobManager.performConcurrentJob(...) as per specification. Also added regression test SearchTest.testNullProgressMonitor()
Verified.