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
|
@ -8984,7 +8984,7 @@ class Character implements java.io.Serializable, Comparable<Character>, Constabl
|
|||
|
||||
// Load and use the archived cache if it exists
|
||||
CDS.initializeFromArchive(CharacterCache.class);
|
||||
if (archivedCache == null || archivedCache.length != size) {
|
||||
if (archivedCache == null) {
|
||||
Character[] c = new Character[size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
c[i] = new Character((char) i);
|
||||
|
@ -8992,6 +8992,7 @@ class Character implements java.io.Serializable, Comparable<Character>, Constabl
|
|||
archivedCache = c;
|
||||
}
|
||||
cache = archivedCache;
|
||||
assert cache.length == size;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue