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 17683 - Changing targets on an ant build file reformats code.
Summary: Changing targets on an ant build file reformats code.
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@editor
: 21385 24514 (view as bug list)
Depends on: 20532
  Show dependency tree
Reported: 2001-11-14 20:18 UTC by mclaassen
Modified: 2003-06-30 14:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description mclaassen 2001-11-14 20:18:50 UTC
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 description="Hello2" name="number2">
        <!-- WRITEME -->

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"


<tag attrib1="foo"     attrib2="bar">

This happens to be 100% of the time.
Comment 1 mclaassen 2001-11-14 20:39:22 UTC
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.
Comment 2 mclaassen 2001-11-14 20:43:43 UTC
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.
Comment 3 Jan Lahoda 2001-11-14 21:46:37 UTC
   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.
Comment 4 Jesse Glick 2001-11-19 14:26:55 UTC
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.
Comment 5 Jesse Glick 2002-03-19 18:36:12 UTC
*** Issue 21385 has been marked as a duplicate of this issue. ***
Comment 6 Jesse Glick 2002-06-07 19:04:20 UTC
*** Issue 24514 has been marked as a duplicate of this issue. ***
Comment 7 Jesse Glick 2002-06-07 19:05:17 UTC
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
Comment 8 Quality Engineering 2003-06-30 14:43:45 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.

Comment 9 Quality Engineering 2003-06-30 14:46:29 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.