Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348768

Summary: NPE thrown when selecting 'Edit Namespace Prefixes' from the 'XPath' view's view menu with no editors open
Product: [WebTools] WTP Source Editing Reporter: Nitin Dahyabhai <thatnitind>
Component: wst.xpathAssignee: Jesper Moller <jesper>
Status: RESOLVED FIXED QA Contact: Jesper Moller <jesper>
Severity: major    
Priority: P3 CC: david_williams, d_a_carver, raghunathan.srinivasan, remy.suen, thatnitind
Version: 3.3   
Target Milestone: 3.4   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 333685    
Bug Blocks:    

Description Nitin Dahyabhai CLA 2011-06-08 11:39:11 EDT
+++ This bug was initially created as a clone of Bug #333685 +++

I20101208-1300 (3.7M4)

1. Install 'Eclipse XSL Developer Tools' from the Indigo site.
2. Restart when prompted.
3. Window > Open Perspective > Other... > XML
4. Activate the 'XPath' view.
5. Ctrl+F10 > Edit Namespace Prefixes
6. Nothing happens. An NPE is logged.

The code assumes that there is an active editor around (not always true). Perhaps the menu item should not be enabled if there isn't an active editor? Or maybe completely hidden?

java.lang.NullPointerException
at org.eclipse.wst.xml.xpath.ui.internal.handler.PrefixHandler.execute(PrefixHandler.java:51)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:824)
at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:810)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:800)
Comment 1 Jesper Moller CLA 2012-04-25 19:46:24 EDT
Fixed and released
Comment 2 Jesper Moller CLA 2012-04-25 19:55:32 EDT
Changed to correct version number
Comment 3 Jesper Moller CLA 2012-04-25 19:57:29 EDT
Mylyn got me there, didn't find the right version field.