Hi Stefan,
we're using ant from within our ArcStyler IDE in-process. Inside our IDE, we're
using
the system properties to transport context information between classes that run
within
different class loaders. As an example, we're writing things like
----------------------------------
System.getProperties().put("myKey", new Integer(3));
----------------------------------
This appears to be completely legal regarding the JDK. The getProperty() method
implemented in the JDK simply ignores non-string values:
----------------------------------
public String getProperty(String key) {
Object oval = super.get(key);
String sval = (oval instanceof String) ? (String)oval : null;
return ((sval == null) && (defaults != null)) ? defaults.getProperty(key) :
sval;
}
----------------------------------
This might be feasible for ant, too. Or, ant may use a toString() on the
objects. Both
make sense in some situations. However, the current behaviour of ant is that it
throws
a class cast exception, which shouldn't be.
If you decide to interpret the semantics of the Properties class in a strict
way, I
would suggest writing
----------------------------------
String value = systemP.getProperty(name);
----------------------------------
instead of
----------------------------------
String value = (String) systemP.get(name);
----------------------------------
-- best regards,
Peter.
Interactive Objects Software GmbH
---- < iO > ----------------------------------------------------------
Interactive Objects Software GmbH (iO) phone (+49)-761-400 73-0
Baslerstr. 63, 79100 Freiburg, Germany fax (+49)-761-400 73-73
mailto:[EMAIL PROTECTED] http://www.io-software.com
______________________________________________________________________
ArcStyler - the IT-Architectural IDE for J2EE/EJB
-> free trial-version at http://www.ArcStyler.com
-> recent Awards at http://www.ArcStyler.com/news
[EMAIL PROTECTED] wrote:
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=904
>
> *** shadow/904 Thu Mar 8 09:38:29 2001
> --- shadow/904.tmp.27780 Mon Mar 12 03:48:04 2001
> ***************
> *** 5,11 ****
> | Status: NEW Version: 1.2
> |
> | Resolution: Platform: All
> |
> | Severity: Normal OS/Version: All
> |
> ! | Priority: Component: Core
> |
>
> +----------------------------------------------------------------------------+
> | Assigned To: [EMAIL PROTECTED] |
> | Reported By: [EMAIL PROTECTED] |
> --- 5,11 ----
> | Status: NEW Version: 1.2
> |
> | Resolution: Platform: All
> |
> | Severity: Normal OS/Version: All
> |
> ! | Priority: High Component: Core
> |
>
> +----------------------------------------------------------------------------+
> | Assigned To: [EMAIL PROTECTED] |
> | Reported By: [EMAIL PROTECTED] |
> ***************
> *** 31,34 ****
> 207c207
> < String value = (String) systemP.get(name);
> ---
> ! > String value = systemP.get(name).toString();
> --- 31,41 ----
> 207c207
> < String value = (String) systemP.get(name);
> ---
> ! > String value = systemP.get(name).toString();
> !
> ! ------- Additional Comments From [EMAIL PROTECTED] 2001-03-12 03:48 -------
> ! Peter, could you please explain this a little more?
> !
> ! 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?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]