Community
Participate
Working Groups
Build ID: M20060921-0945 Steps To Reproduce: 1. Create an RCP app with a PlatformRunnable 2. Use PlatformUI.getWorkbench().restart() within the PlatformRunnable, before the event dispatcher is started More information: The workbench should check its state and throw an IllegalArgumentException or alike, not NPE. !ENTRY org.eclipse.ui.workbench 4 2 2007-01-16 10:30:14.632 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.Workbench.getWorkbenchWindows(Workbench.java:1009) at org.eclipse.ui.internal.Workbench$13.run(Workbench.java:740) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.internal.Workbench.saveAllEditors(Workbench.java:735) at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:655) at org.eclipse.ui.internal.Workbench.access$8(Workbench.java:639) at org.eclipse.ui.internal.Workbench$14.run(Workbench.java:839) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.Workbench.close(Workbench.java:837) at org.eclipse.ui.internal.Workbench.restart(Workbench.java:1644)
Can you give more details please? Where did you call the restart? Is it in your activator code somewhere? Which event dispatcher are you referring to?
/* (non-Javadoc) * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object) */ public Object run(Object args) throws Exception { Display display = PlatformUI.createDisplay(); // Bug 170601: Leads to NPE Job job = new Job("Foo") { @Override protected IStatus run(IProgressMonitor monitor) { Display.getDefault().asyncExec(new Runnable(){ public void run() { PlatformUI.getWorkbench().restart(); }}); return Status.OK_STATUS; } }; job.schedule(); try { int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor()); if (returnCode == PlatformUI.RETURN_RESTART) { return IPlatformRunnable.EXIT_RESTART; } return IPlatformRunnable.EXIT_OK; } finally { display.dispose(); } }
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.