Re: [EGIT PATCH 2/2] Use Integer.valueOf instead of new Integer
- From
- Roger C. Soares <rogersoares@intelinet.com.br>
- Date
- Feb 8, 2008, 02:52 UTC
- Message-ID
- <47ABC3FD.1000803@intelinet.com.br>
- In-Reply-To
- <200802062115.38212.robin.rosenberg@dewire.com>
Robin Rosenberg escreveu:
Show 15 quoted lines
> onsdagen den 6 februari 2008 skrev Shawn O. Pearce: > >> Use Integer.valueOf(int). Post Java 5 implementations of the J2SE >> are required to cache values between -128 and 127 (inclusive). >> >> Actually, when the Java compiler autoboxes values it does so through >> these static valueOf methods, which were mostly introduced as part >> of the Java 5 API updates. For small common values its cached and >> will thus avoid garbage generation, for less common values it goes >> back to allocating the object. >> > > Thank you for this information. > > -- robin
Yep, this is very good to know. Thanks from me too :) This patches series looks fine to me.
[]s, Roger.