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

Bug 361803

Summary: NodeType:dom_to_xpath and null value
Product: [WebTools] WTP Source Editing Reporter: Lukasz Wycisk <lukasz>
Component: wst.xpathAssignee: Jesper Moller <jesper>
Status: RESOLVED FIXED QA Contact: Jesper Moller <jesper>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 3.4 M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Lukasz Wycisk CLA 2011-10-24 09:38:10 EDT
9. It is not a bug but we think it could be changed. NodeType:dom_to_xpath is a factory method to convert w3c .dom model to XPath model. It returns null when type is unknown. It should not happen in correct w3c implementation. However dom4j implementation has 13 number for own Namespace node. Our suggestion is to let this method return null for unknown types and add null check in each place it is used. There are 7 places but only 4 needed to be change:
ChildAxis
FollowingSiblingAxis
ParentAxis
PrecedingSiblingAxis
Comment 1 Lukasz Wycisk CLA 2011-10-24 09:38:26 EDT
Created attachment 205817 [details]
Patch
Comment 2 Jesper Moller CLA 2011-10-30 20:04:54 EDT
Patch looks good ... Reviewing and testing against HEAD and maintenance branches!
Comment 3 Jesper Moller CLA 2012-04-25 20:08:38 EDT
Regression tested and committed. Thanks, Lukasz!