ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 904] Changed - Reading System Properties may return Objects
Date Mon, 12 Mar 2001 13:32:48 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=904

*** shadow/904	Mon Mar 12 03:48:04 2001
--- shadow/904.tmp.28903	Mon Mar 12 05:32:47 2001
***************
*** 38,41 ****
  
  System.getProperties returns a Properties instance, which by definition contains
  keys and values of type String - nothing else. How would you insert Objects into
! the system properties?
--- 38,55 ----
  
  System.getProperties returns a Properties instance, which by definition contains
  keys and values of type String - nothing else. How would you insert Objects into
! the system properties?
! 
! ------- Additional Comments From curcuru@apache.org  2001-03-12 05:32 -------
! Actually, the Properties object is not strictly String-values only: it does 
! extend Hashtable, which allows any Object values.  It's just that most people 
! only use Strings in Properties blocks.  See the Sun JDK 1.2.2 Javadoc for more.
! Note that using non-String values will probably call any .load()/.save() calls 
! to barf, since they're only expecting Strings.
! Note also that you probably have another bug here: why is it calling systemP.get
! (name) instead of .getProperty?  The get() is just an override of the 
! Hashtable, which will get the value only if it's found in this Properties 
! block.  getProperty will only return String-values, and will also search any 
! defaults that the Properties block has, which is another important Properties 
! feature.  (Note: I have not looked at the surrounding code much, so I don't 
! actually know if you want this - just wanted to point it out)

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


Mime
View raw message