Method invokes inefficient Number constructor; use static valueOf instead
commitc50f8e6a5ec6712dbd3fbb3da49d291cb43c1477
authorYann Simon <yann.simon.fr@gmail.com>
Thu, 19 Mar 2009 09:14:59 +0000 (19 10:14 +0100)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 19 Mar 2009 15:54:41 +0000 (19 08:54 -0700)
treed3d03181303206e4d0b8efa0d880c39a53899d29
parentbee63c7043330e0b3119ba954c8403a5abe36b4e
Method invokes inefficient Number constructor; use static valueOf instead

From FindBugs:
Using new Integer(int) is guaranteed to always result in a new object
whereas Integer.valueOf(int) allows caching of values to be done by the
compiler, class library, or JVM. Using of cached values avoids object
allocation and the code will be faster.
Values between -128 and 127 are guaranteed to have corresponding cached
instances and using valueOf is approximately 3.5 times faster than using
constructor. For values outside the constant range the performance of
both styles is the same.

Signed-off-by: Yann Simon <yann.simon.fr@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit/src/org/spearce/jgit/errors/NoClosingBracketException.java