null pointer error

30 views
Skip to first unread message

Manav Brar

unread,
Jan 19, 2016, 1:39:24 PM1/19/16
to Xtend Programming Language
I have this code throwing Null Pointer error, but not sure why so including the output logs and code https://gist.github.com/braghome/12596a164888125b5b0f

val d = uData.findFirst[data.zuid == Integer.valueOf(agentPartnerId)]
try {
assertThat('''matched user profile should not be null «d»''', d, notNullValue)
} catch (AssertionError ae) {
throw new AssertionError(ae.getMessage, ae.getCause)
}
d

Sven Efftinge (sven@efftinge.de)

unread,
Jan 19, 2016, 4:29:37 PM1/19/16
to xtend...@googlegroups.com
The stacktrace of the NullPointerException points you to the line with the cause. 
In assume that either uData is null or it contains null values.

--
You received this message because you are subscribed to the Google Groups "Xtend Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xtend-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Manav Brar

unread,
Jan 20, 2016, 1:16:42 PM1/20/16
to Xtend Programming Language
brilliant added some logging https://gist.github.com/braghome/9ea78dcb0c584bfd72f0

see strange things in the logs code changes https://gist.github.com/braghome/77a79a317c9f607b5c1d

strangely after I dropped findFirst[function] on favor of filter[function] everything started working, perhaps xtend-lang should be in parity with scala and Java 8  

I have to say findFirst[function] has caused me unnecessary grief :(

Manav Brar

unread,
Jan 20, 2016, 5:31:39 PM1/20/16
to Xtend Programming Language

Manav Brar

unread,
Jan 20, 2016, 6:35:03 PM1/20/16
to Xtend Programming Language
closed the above bug as still see the issue with filter
Reply all
Reply to author
Forward
0 new messages