JDK-6524464 : Long.valueOf(String) should cache
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 5.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2007-02-13
  • Updated: 2011-02-16
  • Resolved: 2009-06-26
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE REQUEST :
The source code for Long.valueOf(String) shows that it returns new Long(parseLong(...)).  It really should return Long.valueOf(parseLong(...)) so that it can take advantage of the cache.

JUSTIFICATION :
More efficient.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
See above
ACTUAL -
See above

---------- BEGIN SOURCE ----------
None -- see source code for java.lang.Long
---------- END SOURCE ----------

Comments
EVALUATION Fixed as part of 6807702.
26-06-2009