Today I've stumpled above a serious auto(un)boxing problem:
Number aNumber = aBooleanValue ? getIntegerObj() : getDoubleObj();
Method getIntegerObj returns an Integer, getDoubleObj a Double. Although aBooleanValue was true while debugging, aNumber contained a Double object after execution. The only explanation I had was an implicit autounboxing and immediat autoboxing. But what if the called get*Obj method returns null?
Even more strange, although autoboxing and autounboxing should be marked as warnings, nothing is marked.