From: Shawn O. Pearce Date: Mon, 27 Apr 2009 23:15:50 GMT Subject: Re: [PATCH JGIT] Method invokes inefficient Number constructor; use static valueOf instead Message-ID: <20090427231550.GK23604@spearce.org> In-Reply-To: <366BBB1215D0AB4B8A153AF047A2878002FCE7E9@dewdfe18.wdf.sap.corp> "Sohn, Matthias" wrote: > 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. NAK. This thread came up about 5 weeks ago. Please see my reply here: http://thread.gmane.org/gmane.comp.version-control.git/113738/focus=113785 -- Shawn.