Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315488 - NullPointerException with invalid numeric filter
Summary: NullPointerException with invalid numeric filter
Status: RESOLVED FIXED
Alias: None
Product: MAT
Classification: Tools
Component: GUI (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-02 16:24 EDT by Andrew Johnson CLA
Modified: 2010-06-07 11:24 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Johnson CLA 2010-06-02 16:24:46 EDT
To reproduce, bring up a histogram then in the <Numeric> space type some letters or >ABC

java.lang.NullPointerException
at org.eclipse.mat.query.refined.Filter$NumericFilter.number(Filter.java:225)
at org.eclipse.mat.query.refined.Filter$NumericFilter.setCriteria(Filter.java:200)
at org.eclipse.mat.ui.internal.viewer.RefinedResultViewer$18.updateCriteria(RefinedResultViewer.java:1014)
at org.eclipse.mat.ui.internal.viewer.RefinedResultViewer$18.handleEvent(RefinedResultViewer.java:1000)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
at org.eclipse.swt.widgets.Control.traverse(Control.java:3385)
at org.eclipse.swt.widgets.Control.translateTraversal(Control.java:3367)
at org.eclipse.swt.widgets.Display.translateTraversal(Display.java:4204)
at org.eclipse.swt.widgets.Display.filterMessage(Display.java:1155)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3289)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.mat.ui.rcp.Application.start(Application.java:26)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
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:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Comment 1 Andrew Johnson CLA 2010-06-02 16:25:55 EDT
The fix is trivial - in Filter.java the parse method can return null, so the success should be checked before converting to a double.
Comment 2 Andrew Johnson CLA 2010-06-07 11:24:56 EDT
Fix is to parse the Number, check the parse was successful, and only convert the Number (not null) to a double if successful.