Project: Eclipse_Platform_UI
Bug 122957 NPE in PatternFilter.match
Reported: 2006-01-06 15:01:57 | Status: verified fixed

I20060105-0800 I found this NPE in my log today. I don't know how it was caused, but from a quick look at the code it's possible for the "matcher" field to be null and it is not checked... java.lang.NullPointerException at org.eclipse.ui.internal.dialogs.PatternFilter.match(PatternFilter.java:104) at org.eclipse.ui.internal.dialogs.PatternItemFilter.wordMatches(PatternItemFilter.java:47) at org.eclipse.ui.internal.dialogs.WizardPatternFilter.isElementMatch(WizardPatternFilter.java:100) at org.eclipse.ui.internal.dialogs.FilteredTree.getFirstHighlightedItem(FilteredTree.java:238) at org.eclipse.ui.internal.dialogs.FilteredTree.access$3(FilteredTree.java:236) at org.eclipse.ui.internal.dialogs.FilteredTree$3.keyTraversed(FilteredTree.java:205) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:222) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:914) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:923) at org.eclipse.swt.widgets.Control.traverse(Control.java:2948) at org.eclipse.swt.widgets.Control.translateTraversal(Control.java:2929) at org.eclipse.swt.widgets.Display.translateTraversal(Display.java:3810) at org.eclipse.swt.widgets.Display.filterMessage(Display.java:992) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2903) at org.eclipse.jface.window.Window.runEventLoop(Window.java:808) at org.eclipse.jface.window.Window.open(Window.java:786) at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:114) at org.eclipse.jface.action.Action.runWithEvent(Action.java:492) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:530) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:480) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:392) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:914) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3287) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2907) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1790) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1754) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:403) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:109) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:381) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 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:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/FilteredTree.java