Bug 476724 - Remove new Boolean and Boolean.valueOf().booleanValue()

The new Boolean constructor creates a new instance of a Boolean object, but it
can easily be replaced with Boolean.valueOf which returns the reference to the
global Boolean.TRUE or Boolean.FALSE. Replace calls to new Boolean() with
Boolean.valueOf() for identical semantics except without object collection.

Additionally Boolean.valueOf().booleanValue() is identical to
Boolean.parseBoolean() and will result in no garbage. In addition, methods will
be (slightly) smaller and parseBoolean will often be in-lined by the JIT, which
can often prove that the value is non-null for faster checking. Replace
Boolean.valueOf().booleanValue() chains with Boolean.parseBoolean().

Some other tests can use Wrapper.valueOf() to take advantage of the built-in
caches that these objects maintain (for values in the range -128..127).

Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Change-Id: I5da4216a26ffbb6b8fd3365515ee800dd82b36ae
61 files changed