I can't find the relevant portion of the spec to answer this.
In a conditional operator statement in Java, are both the true and false arguments evaluated?
So could the following throw a NullPointerException
Integer test = null;
test != null ? test.intValue() : 0;
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…