PDA

View Full Version : [FIXED] Bug in Radio setValue(Boolean value) method



dvshestakov
31 Jul 2008, 8:48 AM
When I set null value, I get '[ERROR] Uncaught exception escaped
java.lang.NullPointerException: null' exception. See the 'if (value && group != null)...' expression, it is not right expression, it is threw 'Incompatible types for '&&' operation'.

gslender
31 Jul 2008, 1:34 PM
why are you setting a null value for something that needs true (set) or false (unset) ??

dvshestakov
31 Jul 2008, 8:12 PM
What do you mean - why? If some method has Boolean or Object type, you may set null value, am I right? You must check input value, if you give this method Object type, else you should use simple type, like boolean, for example.
I found some method, which reset value for this component and there only the 'reset()' method, which restore original value, I don't want to restore original value, I want to reset all values in some form. For example, when I press the "Cancel' button on form.

gslender
31 Jul 2008, 9:08 PM
If some method has Boolean or Object type, you may set null value, am I right? You must check input value, if you give this method Object type, else you should use simple type, like boolean, for example.

I don't think so, eg compareTo in String throws a NPE if you pass a null, and there are many more that exist like that within Java API and other libraries.

Whilst I understand your desire to have the library catch all possible odd scenarios, I don't think it would be fair to assume a bug exists... though I guess this would be up to Darrell (lead developer) to decide.

Cheers,
Grant

darrellmeyer
5 Aug 2008, 9:25 AM
Fix is in SVN.