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.
The is basically the default ant script produced by netbeans. <?xml version="1.0" encoding="UTF-8"?> <project basedir="." default="number2" name="changeme"> <target description="Hello" name="number1"> <!-- WRITEME --> </target> <target description="Hello2" name="number2"> <!-- WRITEME --> </target> </project> Change the "name" attribute in one of the targets to appear before the description. Like: <target name="number2" description="Hello2"> Save changes. Now in the properties editor, change the default target. The text will reformat itself to be like it was. New lines in tags that span lines are also removed so: <tag attrib1="foo" attrib2="bar"> becomes <tag attrib1="foo" attrib2="bar"> This happens to be 100% of the time.
It seems that instead of launching ant with a different target (as I thought), changing the default target in the properties editor actually changes the default in the file; likely the trigger that reformats everything. It would be nice if there was an easier way to switch targets for ant execution. Now you need to go to the expert tab, click on the ... by the ant execution, and then set its properties. IMHO, this should be a bit easier to get to. Maybe have another property that would have a default that would be the default used by the netbeans execution module, but not effect the default in the ant file. I like being able to choose the default from a list.
Another user showed me the list can be found if the node is expanded, and I can execute from here. This is helpful, but I have a lot of little targets makeing this list really long. I would still like to see in a combo box somewhere. So, maybe I should humbly change this to a P3 bug and maybe have a feature request for the other issue.
Hi, I do not see any clue pointing to editor in this case. The problem, IMO, is that ant module parsers xml into the tree, you make change via properties in the tree and the code is regenerated from tree, and therefore changed in aspects "irrelevat" for xml point of view. I am reassign to ant, Jesse, please reassign back if you disagree.
Reformatting of scripts in ways insignificant to the XML parse tree is a known problem with the Ant problem. It can only be fixed by throwing out the current ad-hoc XML support and using proper support provided by the XML module (text -> DOM -> text) when that is available (it is not yet; maybe for 3.4). Sorry.
*** Issue 21385 has been marked as a duplicate of this issue. ***
*** Issue 24514 has been marked as a duplicate of this issue. ***
BTW explanation: Xerces parser does not retain info re. order of attributes on elements (and DOM does not require it to either). So when code is regenerated, the serializer arbitrarily alphabetizes the attributes.
Resolved for 3.3.x or earlier, no new info since then -> closing.