Community
Participate
Working Groups
Build ID: M20090211-1700 (3.4.2) Steps To Reproduce: Use the following Java source code example: int missingMsg = (true == false) ? 0 : null; missingMsg = (true == false) ? null : 0; int workingMsg = (true == false) ? null : null; Only the last line shows the correct annotation error: "Type mismatch: cannot convert from null to int"
This is consistent with what javac is doing.
What is comment 1 supposed to mean? a) Null pointer exceptions at runtime are the way to go b) NPEs do not happen often enough, this might bring them more fame c) Eclipse JDT cannot do better than javac d) javac is perfect, do no more e) relocate the bug to the javac-development team f) ??? Sorry, if I am missing formality (just wrote down my thoughts ;o) Surely there is a notion I am not aware of, please explain.
The answer is c & e We cannot report an error case that is NOT in the spec. If the spec is changed, then we would make change.
Closing since this is a spec issue
Verified for 3.6M1