JDK-4990346 : wrapper static factories fail to cache as required
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8,windows_xp
  • CPU: generic,x86
  • Submitted: 2004-02-06
  • Updated: 2021-04-30
  • Resolved: 2004-03-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b42Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
The latest boxing spec filed under CCC 4989021 requires an implementation
to cache boxed values in the range -128 to 127.  The following test case
for this property fails, showing that we don't cache.

class CacheBox {
    public static void main(String[] args) {
        Integer i1 = 12;
        Integer i2 = 12;
        if (i1 != i2) throw new Error();
    }
}

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta2 FIXED IN: tiger-beta2 INTEGRATED IN: tiger-b42 tiger-beta2
14-06-2004

SUGGESTED FIX Use a static nested class with a static array to implement the cache. The cache is created lazily but populated eagerly. ###@###.### 2004-03-01
01-03-2004

EVALUATION Yes, if the returned values have to be == a cache will be necessary. ###@###.### 2004-02-09
09-02-2004