On 14/11/2011 11:19 PM, Neil Richards wrote:
On Mon, 2011-11-14 at 10:28 +1000, David Holmes wrote:
On 12/11/2011 10:14 PM, Alan Bateman wrote:
On 11/11/2011 19:37, Darryl Mocek wrote:
Returning null if the value is not a String gives the impression that
there was no property with that key when the property may have been
there and may in fact have been removed.
That's a fair point and probably enough to conclude that this approach
should be dismissed.

The toString approach is inconsistent so I think this brings us back to
the original suggestion which is to specify that CCE is thrown (as it
always has) but without side effects (meaning it doesn't remove the
property). I think this is the best we can do with this broken API.

I tend to agree. If the value is not a string then leave it alone and
throw CCE.

Of course, there are certain situations where the Java documentation
guides you to specify property values which are not String objects.

One that springs to my mind is the setting of "java.naming.corba.orb" to
point to the ORB instance to be used by the JNDI/COS Naming Service
Provider [1].

But these are not System property values being described.

David
-----


(For those using this provider, this setting tends to be important in
limiting the resources it consumes).

So I'm not sure it's correct to assume that it is an error for Property
settings to have non-String values.

Regards, Neil

[1] 
http://download.oracle.com/javase/7/docs/technotes/guides/jndi/jndi-cos.html#PROP

Reply via email to