The static factory methods Integer.valueOf(int), Long.valueOf(long), etc. were introduced in JDK 5 for javac to implement the caching behavior required by the autoboxing specification. While the specification of those methods say they might cache, they do not require caching of the ranges in question. The specification should be updating to require caching of the boxing range, but clearly state that caching outside of that range may or may not happen.
- relates to
-
JDK-4990346 wrapper static factories fail to cache as required
- Resolved
-
JDK-6879368 Remove stray quote in Character javadoc
- Resolved
-
JDK-6551598 Boolean page should relate TRUE and FALSE to autoboxing
- Closed
-
JDK-8145468 update java.lang APIs with new deprecations
- Resolved
-
JDK-7190924 5.1.7: JLS does not mention caching of autoboxed longs
- Closed