mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8200478: For boxing conversion javac uses Long.valueOf which does not guarantee caching according to its javadoc
Reviewed-by: bpb
This commit is contained in:
parent
1515d70930
commit
15ef60b350
2 changed files with 5 additions and 7 deletions
|
@ -1164,10 +1164,8 @@ public final class Long extends Number implements Comparable<Long> {
|
|||
* significantly better space and time performance by caching
|
||||
* frequently requested values.
|
||||
*
|
||||
* Note that unlike the {@linkplain Integer#valueOf(int)
|
||||
* corresponding method} in the {@code Integer} class, this method
|
||||
* is <em>not</em> required to cache values within a particular
|
||||
* range.
|
||||
* This method will always cache values in the range -128 to 127,
|
||||
* inclusive, and may cache other values outside of this range.
|
||||
*
|
||||
* @param l a long value.
|
||||
* @return a {@code Long} instance representing {@code l}.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue