Bug 278518 - [Quick fix] Add a manual boxing/unboxing option when checking for automatic boxing/unboxing
Summary: [Quick fix] Add a manual boxing/unboxing option when checking for automatic b...
Status: RESOLVED DUPLICATE of bug 204352
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
Depends on:
Blocks:
 
Reported: 2009-05-30 10:10 EDT by Jean Hominal CLA
Modified: 2009-05-30 13:14 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean Hominal CLA 2009-05-30 10:10:54 EDT
Build ID: I20090515-1143

Steps To Reproduce:
1. Configure the JDT to report "Boxing and unboxing conversions", at least to warning level.

2. Write:
> Boolean boxed = true;
> boolean unboxed = Boolean.TRUE;

3. Check that none of the proposed quick fixes actually fixes the problem.

More information:
I would like to have the following fixes available:

When autoboxing (Boolean boxed = true;):
* Box manually 
> Boolean boxed = Boolean.valueOf(true);
In cases where it is possible, it would be nice to be able to replace the described line with a more natural:
> Boolean boxed = Boolean.TRUE;

When auto-unboxing (boolean unboxed = Boolean.TRUE)
* Unbox manually
> boolean unboxed = Boolean.TRUE.booleanValue();
Once again, it would be nice, in such a simple case, to simply have:
> boolean unboxed = true;

Though I have only covered the case of boolean/Boolean variables in this report, I have experienced similar problems with Integer/int and Long/long types, and would like to see similar solutions adopted for all auto types where autoboxing/unboxing applies.
Comment 1 Jean Hominal CLA 2009-05-30 13:14:21 EDT

*** This bug has been marked as a duplicate of bug 204352 ***