Skip to content

I20150811-1400

@alblue alblue tagged this 11 Aug 00:38
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(...)`

Bug: 474069
Change-Id: I1cf2893f64964abd823d5d7700a99616959e08a5
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Assets 2
Loading