Dogfooding - Bug 572300 - Primitive boxed just to call toString.

In a number of classes.

A boxed primitive is allocated just to call toString(). It is more
effective to just use the static form of toString which takes the
primitive value. So,


Replace...

With this...

new Integer(1).toString() Integer.toString(1)
new Long(1).toString() Long.toString(1)
new Float(1.0).toString() Float.toString(1.0)
new Double(1.0).toString() Double.toString(1.0)
new Byte(1).toString() Byte.toString(1)
new Short(1).toString() Short.toString(1)
new Boolean(true).toString() Boolean.toString(true)

Rank: Of Concern (16), confidence: High
Pattern: DM_BOXED_PRIMITIVE_TOSTRING
Type: Bx, Category: PERFORMANCE (Performance)


Change-Id: Ie2f7cbada6dfd4fb51495dd6b8e83c38bb675812
Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
11 files changed