This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257322 - XML format does not work for Spiring application context configuration file
Summary: XML format does not work for Spiring application context configuration file
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: Spring (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Martin Fousek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-28 18:53 UTC by wqtnetbeans
Modified: 2016-10-28 12:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
minimal sample demonstrating failing formatting with a blank line in the comment (169 bytes, text/xml)
2016-10-28 12:44 UTC, aikebah
Details
minimal sample demonstrating working formatting with no blank line in the comment (169 bytes, text/xml)
2016-10-28 12:45 UTC, aikebah
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wqtnetbeans 2015-12-28 18:53:52 UTC
Product Version = NetBeans IDE 8.1 (Build 201510222201)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0_66
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.66-b17

Reproducibility: Happens every time

STEPS:
  * enable Spring MVC supoort
  * Open Spring application context XML file
  * click "shift+alt+f" to format

ACTUAL:
  nothing happens

EXPECTED:
  Spring XML should be formatted per editor configuration in ID
Comment 1 wqtnetbeans 2015-12-28 18:53:56 UTC
Created attachment 157939 [details]
IDE log
Comment 2 wqtnetbeans 2015-12-28 19:02:21 UTC
Correction: this does NOT happen all the time, only sometimes. I can't yet see what scenario would trigger the problem.

Thanks.
Comment 3 wqtnetbeans 2015-12-30 07:06:14 UTC
update:

This is always reproducible - the Maven settings.xml in the .m2 directory, which shows up in a all Maven project together with the pom.xml. The format never happens for the settings.xml although the content can be edited.
Comment 4 Petr Hejl 2016-05-17 13:04:13 UTC
Works fine for me. The only case when it does not work is when the XML has only root element (attributes of such elements are not formatted).
Comment 5 aikebah 2016-10-28 12:44:20 UTC
Created attachment 162671 [details]
minimal sample demonstrating failing formatting with a blank line in the comment
Comment 6 aikebah 2016-10-28 12:45:06 UTC
Created attachment 162672 [details]
minimal sample demonstrating working formatting with no blank line in the comment

I found this bug when I had similar behaviour with an XML-file (in my case a maven pom.xml. Other pom files still formatted fine, so I did a bit of comparison and trimming down.

My guess is that all occurrences will have a multi-line comment with a blank line in the XML file. That at least triggered the not-formatting-issue in my case (and could be resolved by simply removing the blank separator line in the multiline comment.

Attached minimal samples for a working and not working case that demonstrate that the only difference between them is a blank line in the line comment.

Both have wrong indentation for the child element. On the formattingfails.xml the code formatting (Alt-Shift-F) does not re-indent. On the formattingworks.xml it properly re-indents.