| Summary: | NPE in DefaultXMLPartitionFormatter | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Source Editing | Reporter: | Valentin Baciu <valentinbaciu> | ||||||
| Component: | wst.xml | Assignee: | Rakesh <rakes123> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | Nitin Dahyabhai <thatnitind> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | keith.chong.ca, nsand.dev, rakes123 | ||||||
| Version: | 3.2 | Flags: | nsand.dev:
review+
|
||||||
| Target Milestone: | 3.2.2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 174980 [details]
patcha
A simple null pointer check seems to solve the issue.
Patch looks good to me. Thanks. Fixed in Maintenance and HEAD. Verified with M-3.2.2-20100820035731 and I-3.3.0-20100820155725. |
Created attachment 174352 [details] Full stack trace I've hit this NPE when executing the follow XML schema editing scenario: - create a new XML schema file with the New XML Schema wizard - go to the graphical view - select the elements compartment in the top level index figure - right click and add a new element - click away from the direct edit box to finish adding - select the element - right click and choose remove from the context menu - go to the source view - the cursor should be right before the schema element's opening tag angle bracket - hit Ctrl+Shift+F to format the document - note the NPE Here's part of the stack trace (see attachment for the full trace): java.lang.NullPointerException at org.eclipse.wst.xml.core.internal.formatter.DefaultXMLPartitionFormatter.formatStartTag(DefaultXMLPartitionFormatter.java:552) at org.eclipse.wst.xml.core.internal.formatter.DefaultXMLPartitionFormatter.formatRegion(DefaultXMLPartitionFormatter.java:438) at org.eclipse.wst.xml.core.internal.formatter.DefaultXMLPartitionFormatter.formatSiblings(DefaultXMLPartitionFormatter.java:481) at org.eclipse.wst.xml.core.internal.formatter.DefaultXMLPartitionFormatter.format(DefaultXMLPartitionFormatter.java:204) at org.eclipse.wst.xml.core.internal.formatter.DefaultXMLPartitionFormatter.format(DefaultXMLPartitionFormatter.java:160) at org.eclipse.wst.xml.ui.internal.XMLFormattingStrategy.format(XMLFormattingStrategy.java:61) at org.eclipse.jface.text.formatter.MultiPassContentFormatter.formatMaster(MultiPassContentFormatter.java:193) at org.eclipse.wst.sse.ui.StructuredTextMultiPassContentFormatter.formatMaster(StructuredTextMultiPassContentFormatter.java:56) at org.eclipse.jface.text.formatter.MultiPassContentFormatter.format(MultiPassContentFormatter.java:142) at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.doOperation(StructuredTextViewer.java:515) at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131) ...