Community
Participate
Working Groups
My RCP application's WorkbenchAdvisor subclass' preWindowOpen method looks like this: super.preWindowOpen(configurer); configurer.setShowCoolBar(false); configurer.setShowPerspectiveBar(true); It throws the NullPointerException listed below. If I pass true to setShowCoolBar everything works normally. java.lang.NullPointerException at org.eclipse.ui.internal.PerspectiveSwitcher.setCoolItemSize(PerspectiveSwitcher.java:448) at org.eclipse.ui.internal.PerspectiveSwitcher.setPerspectiveBarLocation(PerspectiveSwitcher.java:189) at org.eclipse.ui.internal.PerspectiveSwitcher.createControl(PerspectiveSwitcher.java:132) at org.eclipse.ui.internal.WorkbenchWindow.createDefaultContents(WorkbenchWindow.java:762) at org.eclipse.ui.internal.WorkbenchWindowConfigurer.createDefaultContents(WorkbenchWindowConfigurer.java:538) at org.eclipse.ui.application.WorkbenchAdvisor.createWindowContents(WorkbenchAdvisor.java:637) at org.eclipse.ui.internal.WorkbenchWindow.createContents(WorkbenchWindow.java:680) at org.eclipse.jface.window.Window.create(Window.java:348) at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:987) at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:174) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:658) at org.eclipse.ui.internal.Workbench.init(Workbench.java:819) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1325) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at com.mycorp.MyApp.run(MyApp.java:24) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129) 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:183) at org.eclipse.core.launcher.Main.run(Main.java:644) at org.eclipse.core.launcher.Main.main(Main.java:628)
Are you using the release version of 3.0 or something previous to it?
I'm using the 3.0 final release. I was previously using RC2 without any problems.
Need to handle the case when getLeft() is null. A workaround may be to specify the following in your primary feature plugin's plugin_customization.ini file: org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topLeft
No, that workaround does not work. The same code is run if the location is topLeft.
The following workaround to put the perspective bar on the left does work, but may not be what the app wants. org.eclipse.ui/DOCK_PERSPECTIVE_BAR=left org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false
This regression apparently was due to the changes for bug 60768. My bad that this wasn't caught in the final test pass. I'll write some regression tests for this and similar cases in the RCP test suite.
I've released regression tests for all combinations of showCoolbar and showPerspectiveBar, and a temporary null check for the NPE here.
This problem is fixed. The code causing this problem was removed.
Note, I Ran RCP tests and UI tests .. all passed with fix
Should release this to the 3.0.1 stream as well.
*** Bug 69084 has been marked as a duplicate of this bug. ***
Where can i get hold of the fixed code? We are having this problem as well. Thanks
Hanna could you put a patch in this bug report. I will then apply if for 3.0.1.
Created attachment 13248 [details] Fix for NPE for 3.0.1
fixed in Branch for 3.0.1
verified in HEAD, waiting for 3.0.1 build
verified in 3.0.1