git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [EGIT PATCH 2/2] Use Integer.valueOf instead of new Integer

From
RSRoger 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.

Previous: Robin RosenbergNext: Roger C. Soares
Message 11 of 13 in “Cleanups and javadocs”
  1. Cleanups and javadocsRobin Rosenberg, Feb 5, 2008
  2. 1/6 Comment some empty blocks that should be emptyRobin Rosenberg, Feb 5, 2008
  3. 2/6 Cleanup unboxing/boxingRobin Rosenberg, Feb 5, 2008
  4. 3/6 Do not require javadoc in egit.core test projectRobin Rosenberg, Feb 5, 2008
  5. 4/6 Javadoc update for EgitRobin Rosenberg, Feb 5, 2008
  6. 5/6 Drop unused GitBlobStorage classRobin Rosenberg, Feb 5, 2008
  7. 6/6 Tighten requirements on javadoc.Robin Rosenberg, Feb 5, 2008
  8. Shawn O. PearceFeb 6, 2008
  9. 1/2 Use Boolean.valueOf instead of new BooleanRobin Rosenberg, Feb 6, 2008
  10. 2/2 Use Integer.valueOf instead of new IntegerRobin Rosenberg, Feb 6, 2008
  11. Roger C. SoaresFeb 8, 2008
  12. Roger C. SoaresFeb 5, 2008
  13. Robin RosenbergFeb 5, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.