Integer a = true?null:0;
Works Fine
Integer b=null;
Integer a = true?b:null;
Works Fine
Integer b=null;
Integer a = true?b:0;
Runtime Null Pointer Exception
Works the same with Character but not with String or a normal Object
This looks like java is calling a method inside of the b which gives the exception but it is validating first if both ends of the single line if's are the same then it is not calling it and just performing the assign.
Either Way this seems like a bug, shouldn't be calling for a method (like intValue or something) instead it should do a normal assignation of the value correct?
Do you have any information or documentation on the matter?