Re: DoubleBox and Editor framework bug?
Hello Thomas, thank you for your answer.
I understand how the ValueBox with their Render and Parser works.
And i understand the difference using Double and double, so a work arround would be use Double wrapper instead primitive types?
I think would be nice if the editor generate some code to handle this case and report like when the user use some bad input and then this can be reported in to the getErrors() so the NPE wont be raised.
Like when you use bad values
(1a) Bad value(1a)
(empty) bad value(null)
I will put a issue.
2012/11/11 Thomas Broyer <t.broyer@gmail.com>
On Sunday, November 11, 2012 7:47:11 PM UTC+1, Daniel Mauricio Patino León wrote:Seems that edioto framework is trying to get the Double.doubleValue() without check if the object is null.Any one ?DoubleBox uses DoubleParser. DoubleParser returns 'null' if the value is the empty string, and otherwise uses a NumberFormat, and throws a ParserException if it cannot parse. Your edited object's property is of type 'double', not 'java.lang.Double', so when the field is empty, getValue() returns 'null', and the Editor framework tries to unbox the 'null' to put it into your 'double' property, hence the NullPointerException. With any illegal value, DoubleParser throws; in that case, the ValueBoxEditor returns the last known value, which explains why it doesn't throw in that case.I think you can file an issue, but I wonder what the fix should be (if any): what value should be put into your property when the field is empty (i.e. the value is 'null')? or should the Editor framework generate specific code for primitive values to handle nulls and report errors without trying to change the value (to avoid NPEs)?--To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/tSQEZlBuq5kJ.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
ISC. Daniel Mauricio Patiño León.
Director ejecutivo
Liondev S.A. de C.V.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home