8295555: Primitive wrapper caches could be @Stable

Reviewed-by: rriggs
This commit is contained in:
Per Minborg 2023-06-13 08:39:00 +00:00
parent 5d716121c1
commit f7de726bd3
5 changed files with 16 additions and 5 deletions

View file

@ -27,6 +27,7 @@ package java.lang;
import jdk.internal.misc.CDS;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import jdk.internal.vm.annotation.Stable;
import java.lang.constant.Constable;
import java.lang.constant.DynamicConstantDesc;
@ -231,9 +232,10 @@ public final class Short extends Number implements Comparable<Short>, Constable
return Optional.of(DynamicConstantDesc.ofNamed(BSM_EXPLICIT_CAST, DEFAULT_NAME, CD_short, intValue()));
}
private static class ShortCache {
private static final class ShortCache {
private ShortCache() {}
@Stable
static final Short[] cache;
static Short[] archivedCache;