Community
Participate
Working Groups
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) ...
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.