mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8343019: Primitive caches must use boxed instances from the archive
Reviewed-by: jiangli, vlivanov, iklam
This commit is contained in:
parent
ae82cc1ba1
commit
7c36fa7e17
8 changed files with 100 additions and 33 deletions
|
@ -117,7 +117,7 @@ public final class Byte extends Number implements Comparable<Byte>, Constable {
|
|||
|
||||
// Load and use the archived cache if it exists
|
||||
CDS.initializeFromArchive(ByteCache.class);
|
||||
if (archivedCache == null || archivedCache.length != size) {
|
||||
if (archivedCache == null) {
|
||||
Byte[] c = new Byte[size];
|
||||
byte value = (byte)-128;
|
||||
for(int i = 0; i < size; i++) {
|
||||
|
@ -126,6 +126,7 @@ public final class Byte extends Number implements Comparable<Byte>, Constable {
|
|||
archivedCache = c;
|
||||
}
|
||||
cache = archivedCache;
|
||||
assert cache.length == size;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue