null check after item is used in TupleEntry

29 views
Skip to first unread message

Oscar Boykin

unread,
Mar 2, 2015, 1:06:05 PM3/2/15
to cascadi...@googlegroups.com
https://github.com/cwensel/cascading/blob/2.6-wip-60/cascading-core/src/main/java/cascading/tuple/TupleEntry.java#L375

note on line 372 the input is dereferenced.

Then on line 375 there is a null check for the item.

So, if (isUnmodifiable == false) and tuple == null, you get an NPE. If (isUnmodifiable == true) and tuple == null, no NPE.

That seems weird to me. Seems to me either the null check should come first, or it should not be there at all.

Am I missing something?
--
Oscar Boykin :: @posco :: http://twitter.com/posco

Chris K Wensel

unread,
Mar 2, 2015, 1:12:17 PM3/2/15
to cascadi...@googlegroups.com
yeah, that’s dumb. good catch. will fix in 2.7. 

--
You received this message because you are subscribed to the Google Groups "cascading-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cascading-use...@googlegroups.com.
To post to this group, send email to cascadi...@googlegroups.com.
Visit this group at http://groups.google.com/group/cascading-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/cascading-user/CANX%3DQ2rf84FkEsDJ_tphS%2B9keYa%2BJ%3Doqy201nt%3DQ_zcsrjrHHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Chris K Wensel




Reply all
Reply to author
Forward
0 new messages