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 27261] - Properties.propertyNames() instead of .keys()
Date Thu, 26 Feb 2004 16:50:31 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27261>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27261

Properties.propertyNames() instead of .keys()

jessh@ptc.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|Normal                      |Major
           Priority|Other                       |High



------- Additional Comments From jessh@ptc.com  2004-02-26 16:50 -------
There appear to be at least 3 areas potentially affected:
  Project.setSystemProperties() [noted in the original description]
  Diagnostics.doReportSystemProperties()
  CommandlineJava.setSystem()

There may well be others.  I found these by examining usage of
System.getProperties() in close proximity to Hashtable/Properties.keys().

Note that any larger process embedding Ant or any custom task can throw these
areas of Ant into disarray (i.e. into inability to find key JVM system
properties) by simply doing:
  Properties  props = new Properties( System.getProperties() );
  ... add or load additional properties into 'props' ...
  System.setProperties( props );

As long as Ant does not carefully use propertyNames() and getProperty() rather
than keys() and get(), any such calling program or custom task will hide all
system properties from these portions of Ant -- with disastrous and hard to
trace effects.

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


Mime
View raw message