Bug 68774 - [Perspectives] NPE in PerspectiveSwitcher.setCoolItemSize() when coolbar hidden
Summary: [Perspectives] NPE in PerspectiveSwitcher.setCoolItemSize() when coolbar hidden
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P1 critical (vote)
Target Milestone: 3.0.1   Edit
Assignee: Hanna Farah CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 69084 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-28 12:20 EDT by David Graham CLA
Modified: 2004-07-21 14:35 EDT (History)
5 users (show)

See Also:


Attachments
Fix for NPE for 3.0.1 (1.77 KB, patch)
2004-07-14 13:37 EDT, Hanna Farah CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Graham CLA 2004-06-28 12:20:56 EDT
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)
Comment 1 Debbie Wilson CLA 2004-06-28 14:08:52 EDT
Are you using the release version of 3.0 or something previous to it?
Comment 2 David Graham CLA 2004-06-28 15:22:11 EDT
I'm using the 3.0 final release.  I was previously using RC2 without any problems.
Comment 3 Nick Edgar CLA 2004-06-28 16:20:42 EDT
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

Comment 4 Nick Edgar CLA 2004-06-28 16:25:34 EDT
No, that workaround does not work.  The same code is run if the location is topLeft.
Comment 5 Nick Edgar CLA 2004-06-28 16:30:27 EDT
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
Comment 6 Nick Edgar CLA 2004-06-28 16:35:58 EDT
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.
Comment 7 Nick Edgar CLA 2004-06-28 16:55:22 EDT
I've released regression tests for all combinations of showCoolbar and
showPerspectiveBar, and a temporary null check for the NPE here.
Comment 8 Hanna Farah CLA 2004-06-29 14:30:04 EDT
This problem is fixed. The code causing this problem was removed.
Comment 9 Michael Van Meekeren CLA 2004-06-29 14:42:39 EDT
Note, I Ran RCP tests and UI tests .. all passed with fix
Comment 10 Nick Edgar CLA 2004-07-05 11:57:06 EDT
Should release this to the 3.0.1 stream as well.
Comment 11 Nick Edgar CLA 2004-07-05 11:57:17 EDT
*** Bug 69084 has been marked as a duplicate of this bug. ***
Comment 12 Darren Bell CLA 2004-07-14 04:21:41 EDT
Where can i get hold of the fixed code?
We are having this problem as well.

Thanks
Comment 13 Michael Van Meekeren CLA 2004-07-14 08:41:16 EDT
Hanna could you put a patch in this bug report.  I will then apply if for 3.0.1.
Comment 14 Hanna Farah CLA 2004-07-14 13:37:27 EDT
Created attachment 13248 [details]
Fix for NPE for 3.0.1
Comment 15 Michael Van Meekeren CLA 2004-07-14 16:50:24 EDT
fixed in Branch for 3.0.1
Comment 16 Michael Van Meekeren CLA 2004-07-19 13:47:38 EDT
verified in HEAD, waiting for 3.0.1 build
Comment 17 Michael Van Meekeren CLA 2004-07-21 14:35:55 EDT
verified in 3.0.1