Bug 224190

Summary: [CommonNavigator] NPE when non-existent associatedExtensionId
Product: [Eclipse Project] Platform Reporter: Justin Berstler <bjustin>
Component: UIAssignee: Francis Upton IV <francisu>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: francisu
Version: 3.4Keywords: needinfo
Target Milestone: 3.4.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to include additional null checking none

Description Justin Berstler CLA 2008-03-26 16:12:10 EDT
Build ID: I20080305-1100

Steps To Reproduce:
In the event that a commonWizard specifies an associatedExtensionId of a non-existent content extension, the Common Navigator will cause a NullPointerException.  In the case I found (the commonWizard was a "new" wizard) this exception causes the entire New submenu to disappear from the context menu.

More information:
The fix is just to do a little additional null checking in NavigatorActivationService.isNavigatorExtensionActive()  Please see the attached patch.
Comment 1 Justin Berstler CLA 2008-03-26 16:13:17 EDT
Created attachment 93681 [details]
Patch to include additional null checking
Comment 2 Francis Upton IV CLA 2008-05-30 17:12:31 EDT
Justin, would you be willing to take a stab at writing a Junit test case for this?  I'm trying to improve the test coverage of the CNF.  You can just checkout the platform-ui-tests project in CVS and add the test case in org.eclipse.ui.tests.navigator.  If you don't want to, it's no problem, just thought I would ask.

I will get this in for 3.4.1 when that opens.
Comment 3 Francis Upton IV CLA 2008-08-17 17:27:07 EDT
Justin, I cannot reproduce this problem.  I have tried a commonWizard both inside a navigatorContentExtension and outside of it and I don't hit the problem (in fact i don't hit the code you patched at all).  Can you provide a simple RCP app where you can make this happen?  Or maybe a snippet of your configuration?

I'm reluctant to take this patch until I understand exactly what's going on.
Comment 4 Justin Berstler CLA 2008-08-26 10:53:03 EDT
Francis, I am no longer able to reproduce this as well.
Comment 5 Francis Upton IV CLA 2008-08-26 11:26:46 EDT
Seems to work now for everyone without the patch.