-
Bug
-
Resolution: Duplicate
-
P4
-
26
-
generic
-
generic
Comment copied from
There's a report by "Thihup" using "cds" reading:
```
[1.367s][warning][aot,heap] Archive heap points to a static field that may hold a different value at runtime:
[1.367s][warning][aot,heap] Field: sun/util/locale/LanguageTag::EMPTY_SUBTAGS
[1.368s][warning][aot,heap] Value: java.util.Collections$EmptyList
[1.369s][warning][aot,heap] {0x00000000cb006f68} - klass: 'java/util/Collections$EmptyList' - flags:
[1.369s][warning][aot,heap]
[1.370s][warning][aot,heap] - ---- fields (total size 2 words):
[1.371s][warning][aot,heap] - protected transient 'modCount' 'I' @8 0 (0x00000000)
[1.371s][warning][aot,heap] --- trace begin ---
[1.371s][warning][aot,heap] [ 0] {0x00000000cb006f68} java.util.Collections$EmptyList
[1.371s][warning][aot,heap] --- trace end ---
[1.371s][warning][aot,heap]
[1.372s][error ][aot,heap] Scanned 38492 objects. Found 1 case(s) where an object points to a static field that may hold a different value at runtime.
[1.372s][error ][aot,heap] Please see cdsHeapVerifier.cpp and aotClassInitializer.cpp for details
[1.372s][error ][cds ] An error has occurred while writing the shared archive file.
```
With `List.of()` instead of `Collections.emptyList()` that error could be avoided: no static fields in their class(es) implementation(s).
- duplicates
-
JDK-8361717 Refactor Collections.emptyList() in Locale related classes
-
- Resolved
-
- relates to
-
JDK-8357281 sun.util.Locale.LanguageTag should be immutable
-
- Resolved
-