ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31927] New: - System Property Defaults are not carried over in org.apache.tools.ant.types.CommandlineJava.setSystem()
Date Wed, 27 Oct 2004 21:27:00 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31927>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31927

System Property Defaults are not carried over in org.apache.tools.ant.types.CommandlineJava.setSystem()

           Summary: System Property Defaults are not carried over in
                    org.apache.tools.ant.types.CommandlineJava.setSystem()
           Product: Ant
           Version: 1.6.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: m4e35wr02@sneakemail.com


CVS version 1.28 of org.apache.tools.ant.types.CommandlineJava (done just before
Ant 1.5) had a change to the system property
handling in the setSystem method.

The line:

                Properties p = new Properties(sys = System.getProperties());

was changed to:

                sys = System.getProperties();
                Properties p = new Properties();
                for (Enumeration e = sys.keys(); e.hasMoreElements(); ) {
                    Object o = e.nextElement();
                    p.put(o, sys.get(o));
                }

The problem is that the system property defaults are not copied over because
Properties.keys() does not return the defaults in the Enumeration.

We were doing a similar thing:

Properties props = new Properties(System.getProperties())
props.put(...
System.setProperties(props)

As a result, our "old" system properties got turned into defaults.  So, the
setSystem method did not copy them over.

The fix is pretty easy, so I have marked this problem as minor - if it is really
a problem.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message