On Dec 6, 5:55 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
> On 6 déc, 23:32, Geoffrey Wiseman <geoffrey.wise...@gmail.com> wrote:
>
> > I'm seeing some NPEs in PassthroughParser when using TextBox,
> > particularly if you touch getValue(), setValue().  getValueOrThrow()
> > seems to pass a null right up to PassthroughParser.parse(), which
> > calls toString() without checking.  It happend once, we switched to
> > setText(), problem went away.  Happened a second time, seemed worth
> > digging a little deeper.
>
> There sure could be an NPE given the code in PassthroughParser, but
> it's actually only called on the result of getText() which is never
> 'null' (ValueBoxBase, line 216, getValueOfThrow).

On Dec 6, 5:55 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
> There sure could be an NPE given the code in PassthroughParser, but
> it's actually only called on the result of getText() which is never
> 'null' (ValueBoxBase, line 216, getValueOfThrow).

Hm.

Well, I know it can be, because I've seen it in stack traces:

Caused by: java.lang.NullPointerException: null
    at
com.google.gwt.text.shared.testing.PassthroughParser.parse(PassthroughParser.java:
41)
    at
com.google.gwt.text.shared.testing.PassthroughParser.parse(PassthroughParser.java:
1)
    at
com.google.gwt.user.client.ui.ValueBoxBase.getValueOrThrow(ValueBoxBase.java:
213)
    at
com.google.gwt.user.client.ui.ValueBoxBase.getValue(ValueBoxBase.java:
199)
    at
com.google.gwt.user.client.ui.TextBoxBase.getValue(TextBoxBase.java:
105)
    at
com.google.gwt.user.client.ui.TextBoxBase.getValue(TextBoxBase.java:1)
    at
com.google.gwt.user.client.ui.ValueBoxBase.setValue(ValueBoxBase.java:
386)
    at
com.google.gwt.user.client.ui.ValueBoxBase.setValue(ValueBoxBase.java:
382)
    at mydomain.myproject.FollowUpDialog.clear(FollowUpDialog.java:
187)

Unfortunately, I have no idea how it gets in that state, since I'm
unable to reproduce it in a simple GWT Test Case, nor find a hole in
the GWT code that clearly identifies how a null could get in there.
setText() seems well-protected and setValue() clearly invokes
setText().

I don't have the more recent stack trace copied down at the moment,
but I may try and regress our codebase to the point at which either
one of these errors was evident so that I can try and reproduce it.
I'm very curious now, much more so than when I thought it was just a
simple bug that we had a workaround for.

  - Geoffrey

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to