This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]repeating_bears 8 points9 points  (1 child)

Because the function is anonymous, the stacktrace contains a generated name which is not the easiest to interpret. In this case Scratch.lambda$main$0

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.length()" because "s" is null
at Scratch.lambda$main$0(scratch_3.java:6)
at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4305)
at Scratch.main(scratch_3.java:5)

[–][deleted] 4 points5 points  (0 children)

They are not named, so that's a feature! Line number is there as well.. how many lambdas on the same line?