Difference in behaviour of the ternary operator on JDK8 and JDK10
I believe this was a bug which seems to have been fixed. Throwing a NullPointerException seems to be the correct behavior, according to the JLS. I think that what is going on here is that for some reason in version 8, the compiler considered the bounds of the type variable mentioned by the method’s return … Read more