Code Review Request for 6578042
Neil Richards
neil.richards at ngmr.net
Mon Nov 14 13:19:04 UTC 2011
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].
(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
--
Unless stated above:
IBM email: neil_richards at uk.ibm.com
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
More information about the core-libs-dev
mailing list