Community
Participate
Working Groups
Build Identifier: I20111027-1800 The "Java Compiler Errors/Warnings" preferences page should have separate settings for the severity of boxing and unboxing conversions, as unboxing may throw NPE whereas boxing will not. Wanted operation: 1. Set "Boxing conversions" to Ignore 2. Set "Unboxing conversions" to Warning 3. Enter the following code: int a = new Integer(5); Integer b = 5; 4. Only the former line should produce a warning with these settings. Reproducible: Always
(In reply to comment #0) > as unboxing may > throw NPE whereas boxing will not. The warning is not really related to only NPEs. Autoboxing also has a performance cost which programmers might want to know about.
(In reply to comment #1) > The warning is not really related to only NPEs. Autoboxing also has a > performance cost which programmers might want to know about. Sure, but a developer may not be worried about performance but only NPEs. 'It is ok if the application runs a bit slower, as long as it runs without any exception'
*** This bug has been marked as a duplicate of bug 163065 ***
(In reply to comment #2) > (In reply to comment #1) > > The warning is not really related to only NPEs. Autoboxing also has a > > performance cost which programmers might want to know about. > Sure, but a developer may not be worried about performance but only NPEs. I'm not saying i'm against the RFE. Just pointing out another motivation behind the warning. :)
Setting whiteboard for this bug to 'To be verified for 3.8M6' is lame IMHO... I don't know what needs to be 'verified' here.
It's required only when the original bug has a target set or released in the particular milestone.