Re: Code Review Request for 6578042

2011-11-15 Thread David Holmes
On 16/11/2011 8:29 AM, Alan Bateman wrote: On 15/11/2011 19:51, Darryl Mocek wrote: I've modified the fix per feedback (thanks all). System.clearProperty now attempts to get the property with the specified key. If there is such a property, and the value is a String, remove the property and retur

Re: Code Review Request for 6578042

2011-11-15 Thread Alan Bateman
On 15/11/2011 19:51, Darryl Mocek wrote: I've modified the fix per feedback (thanks all). System.clearProperty now attempts to get the property with the specified key. If there is such a property, and the value is a String, remove the property and return the value removed, otherwise return nu

Re: Code Review Request for 6578042

2011-11-15 Thread Darryl Mocek
I've modified the fix per feedback (thanks all). System.clearProperty now attempts to get the property with the specified key. If there is such a property, and the value is a String, remove the property and return the value removed, otherwise return null (if it is null) or throw CCE (if it's

Re: Code Review Request for 6578042

2011-11-14 Thread Neil Richards
On Mon, 2011-11-14 at 13:45 +, Alan Bateman wrote: > On 14/11/2011 13:19, Neil Richards wrote: > > : > > > > 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 se

Re: Code Review Request for 6578042

2011-11-14 Thread David Holmes
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 whe

Re: Code Review Request for 6578042

2011-11-14 Thread Alan Bateman
On 14/11/2011 13:19, Neil Richards wrote: : 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 t

Re: Code Review Request for 6578042

2011-11-14 Thread Neil Richards
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 > >>

Re: Code Review Request for 6578042

2011-11-13 Thread David Holmes
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 probabl

Re: Code Review Request for 6578042

2011-11-12 Thread Alan Bateman
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 sho

Re: Code Review Request for 6578042

2011-11-11 Thread Darryl Mocek
The reason I used the Object's toString method is that there may indeed be an object which is not a String which is stored as a value (this was the reason for the bug report). In this case, the remove method will in fact remove the property. Returning null if the value is not a String gives t

Re: Code Review Request for 6578042

2011-11-06 Thread Alan Bateman
On 02/11/2011 19:59, David Holmes wrote: I'm not seeing a distinction in those two statements. Both expect to return the property value for a given key; both assume a valid value is a String. clearProperty throws ClassCastException if the assumption doesn't hold; getProperty instead returns n

Re: Code Review Request for 6578042

2011-11-02 Thread David Holmes
Hi Alan, On 2/11/2011 7:47 PM, Alan Bateman wrote: On 01/11/2011 23:54, David Holmes wrote: This fix seems inconsistent with how this non-String problem is handled elsewhere. It is, but (for whatever reason) is specified to return "the previous string value of the system property" whereas Pro

Re: Code Review Request for 6578042

2011-11-02 Thread Alan Bateman
On 01/11/2011 23:54, David Holmes wrote: This fix seems inconsistent with how this non-String problem is handled elsewhere. It is, but (for whatever reason) is specified to return "the previous string value of the system property" whereas Properties.getProperty is specified to return "the va

Re: Code Review Request for 6578042

2011-11-01 Thread David Holmes
Hi Darryl, On 2/11/2011 3:51 AM, Darryl Mocek wrote: Hello. Please review this patch to fix Bug #6578042 (System.clearProperty() throws ClassCastException if property value isn't a String). The issue is that through the Hashtable methods, it's possible to add a Property which isn't a String and

Code Review Request for 6578042

2011-11-01 Thread Darryl Mocek
Hello. Please review this patch to fix Bug #6578042 (System.clearProperty() throws ClassCastException if property value isn't a String). The issue is that through the Hashtable methods, it's possible to add a Property which isn't a String and set it through System.setProperties. clearPropert