Pausing on All Null Exceptions, handy for catching null lists in request factory

18 views
Skip to first unread message

Brandon Donnelson

unread,
May 20, 2012, 2:02:24 PM5/20/12
to google-we...@googlegroups.com
Thanks to Thomas for giving me this tip. But catching a null exception in the Resolver class is so much easier when turning this on. 

I so often forget that RequestFactory complains about null lists and finding them is a pain with out stepping through the entire entity get methods, but pausing on all null exceptions is far more handy. So I did a little write up on it to show others that may not know what I'm talking about. 


Brandon Donnelson

DebuggingView.png

Joseph Lust

unread,
May 20, 2012, 10:18:10 PM5/20/12
to google-we...@googlegroups.com
Good point Brandon. Also check out the more advanced conditionals you can use in the lower part of the breakpoint screen. 

For example, for a more advanced algorithm, you might find yourself stepping along manually with F6 and hovering to check the variable values to find a specific condition. However, you could just set these conditions on the breakpoint (i.e. 5th iteration, foo is equal to the nth element of bar and bar.length is greater than 3. Now, as Ron Popeil says, "Just set it and forget it!"



This makes debugging wicked easy. But also be aware that just using a blanked "NullPointerException" breakpoint will expose poorly written code (yours or libs) that has wrapped blocks with try/catches instead of doing null checks (i.e. in JAXB).


Sincerely,
Joseph
Reply all
Reply to author
Forward
0 new messages