> * Release fence guarantees that cacheArray field will published with a > non-null value. > * Without this fix, CacheValueMap.cacheArray can sometimes be seen as null. > > This is a follow up to @PaulSandoz's feedback > [here](https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-August/068248.html) > for the first attempt to fix > [JDK-8251397](https://bugs.openjdk.java.net/browse/JDK-8251397). In this > update, the fence has been moved to > `initializeMap()` and added Paul's suggested comment. > Annotating `classValueMap` with `@Stable` is outside the scope of this issue.
Galder Zamarreño has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision: 8251397: NPE on ClassValue.ClassValueMap.cacheArray Add release fence to ClassValueMap constructor. * Release fence guarantees that cacheArray field will published with a non-null value. * Without this fix, CacheValueMap.cacheArray can sometimes be seen as null. ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/94/files - new: https://git.openjdk.java.net/jdk/pull/94/files/48ff6dde..6c4e82d8 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=94&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=94&range=00-01 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/94.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/94/head:pull/94 PR: https://git.openjdk.java.net/jdk/pull/94