Bug 474074 - Replace new Boolean with Boolean.valueOf
Summary: Replace new Boolean with Boolean.valueOf
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.6 M2   Edit
Assignee: Alex Blewitt CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2015-07-31 18:07 EDT by Alex Blewitt CLA
Modified: 2015-09-14 05:07 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2015-07-31 18:07:41 EDT
Using `new Boolean()` results in the creation of a new object on the
heap, when the flyweight `Boolean.TRUE` and `Boolean.FALSE` are available.

Java 1.4 added a `Boolean.valueOf()` which can be used in place of
`new Boolean()` but which will use the existing flyweight values instead.

Globally change `new Boolean(...)` to `Boolean.valueOf(...)` and replace
`new Boolean(...).booleanValue()` to the equivalent `Boolean.parseBoolean(...)
Comment 1 Eclipse Genie CLA 2015-07-31 18:09:25 EDT
New Gerrit change created: https://git.eclipse.org/r/52998
Comment 2 Sarika Sinha CLA 2015-08-02 23:06:57 EDT
Thanks for the contribution. We will take this up in next Miletstone.
Comment 3 Alex Blewitt CLA 2015-08-12 06:57:06 EDT
Any reason this cannot be merged now?
Comment 4 Sarika Sinha CLA 2015-08-12 12:10:43 EDT
(In reply to Alex Blewitt from comment #3)
> Any reason this cannot be merged now?

Yes, Now M2 has started and we will be taking this up shortly.
Comment 5 Sarika Sinha CLA 2015-09-03 05:12:51 EDT
Have given a minor comment, after that change we can deliver the code.
Comment 6 Alex Blewitt CLA 2015-09-03 05:20:15 EDT
I see no comment in the code review. Did you submit it, or is it still in draft mode?
Comment 7 Sarika Sinha CLA 2015-09-03 05:23:36 EDT
(In reply to Alex Blewitt from comment #6)
> I see no comment in the code review. Did you submit it, or is it still in
> draft mode?

Posted, Thanks.
Comment 8 Alex Blewitt CLA 2015-09-03 07:26:21 EDT
Fixed as per comments
Comment 11 Sarika Sinha CLA 2015-09-04 00:04:33 EDT
.
Comment 12 Sarika Sinha CLA 2015-09-14 05:07:48 EDT
Verified by Source inspection using
Eclipse SDK

Version: Neon (4.6)
Build id: I20150913-2000