| Summary: | [ErrorHandling] NullPointerException when trying to show a Status with OK severity | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Elias Volanakis <elias> | ||||||||
| Component: | UI | Assignee: | Szymon Brandys <Szymon.Brandys> | ||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||
| Severity: | major | ||||||||||
| Priority: | P3 | CC: | eclipse, krzysztof.daniel | ||||||||
| Version: | 3.3 | ||||||||||
| Target Milestone: | 3.3 RC1 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
Created attachment 66998 [details]
Sample plug-in containing an action that exposes this issue.
BTW, I'm using Eclipse 3.3 M7. Created attachment 67482 [details]
Fix 01
+1 Created attachment 67484 [details]
Sample plug-in that does BLOCK and SHOW
Patch released for build >20070516 Great, thanks for fixing this! Elias, could you tell me what do you expect from StatusManager when you try to handle OK status? This is rather unusual scenario, as you should not notify the user about successfully completed action... I understand that NPE is a bug, but I am really not sure if OK status should be displayed... Hi Christopher,
> what do you expect from StatusManager when you try to handle OK status?
if I recall correctly the bug was fixed in 2007.
My expectation was that the status manager would do whatever he does for all other statuses. I though that handling an OK status with StatusManager.LOG is perfectly reasonable, as it provides a centralized way to log stuff and also notifies ILogListeners...
HTH,
Elias.
Yes, this bug was fixed but introduced another one (bug 211933). But since you are relying on this behavior I will not change it. |
When trying to show a status instastance that has the severity IStatus.OK, I get an NullPointerException as shown below. IStatus status = new Status( IStatus.OK, // severity Activator.PLUGIN_ID, IStatus.OK, "Message", null ); StatusManager.getManager().handle( status, StatusManager.SHOW ); Produces the following exception: org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException) at org.eclipse.swt.SWT.error(SWT.java:3547) at org.eclipse.swt.SWT.error(SWT.java:3465) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3650) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3287) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2365) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2204) 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.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) 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(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:497) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436) at org.eclipse.equinox.launcher.Main.run(Main.java:1162) at org.eclipse.equinox.launcher.Main.main(Main.java:1137) Caused by: java.lang.NullPointerException at org.eclipse.ui.internal.statushandlers.StatusNotificationManager$3.run(StatusNotificationManager.java:134) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) ... 23 more Interestingly, if one changes the severity to IStatus.ERROR the status is handled correctly (e.g. the dialog is shown). BTW, I am not using any custom error handler.