Bug 218030 - XML Formatter Throws NPE Formatting a Selected Region
Summary: XML Formatter Throws NPE Formatting a Selected Region
Status: CLOSED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-02-06 12:17 EST by Nick Sandonato CLA
Modified: 2008-04-24 00:45 EDT (History)
1 user (show)

See Also:
thatnitind: review+


Attachments
Patch to Fix NPE (2.83 KB, patch)
2008-02-06 12:17 EST, Nick Sandonato CLA
no flags Details | Diff
Patch to fix other potential NPEs (3.96 KB, patch)
2008-02-06 13:18 EST, Nick Sandonato CLA
nsand.dev: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Sandonato CLA 2008-02-06 12:17:45 EST
Created attachment 89028 [details]
Patch to Fix NPE

Build ID: I20071213-1700

Steps To Reproduce:
1. Create and populate an XML document
2. Create an element who has a parent that does not define the xml:space="preserve" attribute
3. Format just that element


More information:
When attempting to define the formatting constraints for a node, the DefaultXMLFormatter checks the constraints of the region's parent node. When attempting to determine the constraints of the parent node, an NPE is thrown because the parent constraints are null.
Comment 1 Nick Sandonato CLA 2008-02-06 13:18:53 EST
Created attachment 89035 [details]
Patch to fix other potential NPEs

Detected a few more cases where NPEs could occur.
Comment 2 Amy Wu CLA 2008-02-06 21:53:12 EST
fix looks good. released for this week's 3.0 m5 build
Comment 3 Nitin Dahyabhai CLA 2008-02-07 02:31:58 EST
Reopening to clean up the record keeping.  I don't like marking bugs as "fixed" when they're owned by the inbox.
Comment 4 Nitin Dahyabhai CLA 2008-02-07 02:32:41 EST
Marking as fixed again.
Comment 5 Nick Sandonato CLA 2008-02-11 16:52:17 EST
verified in wtp 3.0 m5 20080211073521
Comment 6 David Williams CLA 2008-04-24 00:45:01 EDT
mass change to add 'contributed' keyword based on bugzilla query, please correct if that's not accurate (by marking patches as obsolete and removing the 'contributed' keyword.