This is one for the java purists I think. I recently had an issue with a method to perform a custom parsing of String values to a Boolean. A simple enough task, but for some
Interesting but no answer tells you why this happens in the first place.
This has to do with the ternary expression.
The compiler interprets null as a null reference to Boolean, applies the autoboxing/unboxing rules for Boolean (on a null) => you get a NullPointerException at runtime.