mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +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
|
@ -244,7 +244,7 @@ public final class Short extends Number implements Comparable<Short>, Constable
|
|||
|
||||
// Load and use the archived cache if it exists
|
||||
CDS.initializeFromArchive(ShortCache.class);
|
||||
if (archivedCache == null || archivedCache.length != size) {
|
||||
if (archivedCache == null) {
|
||||
Short[] c = new Short[size];
|
||||
short value = -128;
|
||||
for(int i = 0; i < size; i++) {
|
||||
|
@ -253,6 +253,7 @@ public final class Short extends Number implements Comparable<Short>, Constable
|
|||
archivedCache = c;
|
||||
}
|
||||
cache = archivedCache;
|
||||
assert cache.length == size;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue