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;
@ -105,9 +106,10 @@ public final class Byte extends Number implements Comparable<Byte>, Constable {
return Optional.of(DynamicConstantDesc.ofNamed(BSM_EXPLICIT_CAST, DEFAULT_NAME, CD_byte, intValue()));
}
private static class ByteCache {
private static final class ByteCache {
private ByteCache() {}
@Stable
static final Byte[] cache;
static Byte[] archivedCache;