RFR: 8263995: Incorrect double-checked locking in Types.arraySuperType()

Aleksey Shipilev shade at openjdk.java.net
Mon Mar 22 18:26:47 UTC 2021


In Types.arraySuperType(), SonarCloud reports:
 Remove this dangerous instance of double-checked locking.

Indeed, the `arraySuperType` is not `volatile`, while `IntersectionClassType` has non-`final` fields (both in itself and in superclasses). This is an incorrect DCL.

-------------

Commit messages:
 - 8263995: Incorrect double-checked locking in Types.arraySuperType()

Changes: https://git.openjdk.java.net/jdk/pull/3129/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3129&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8263995
  Stats: 8 lines in 1 file changed: 3 ins; 0 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3129.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3129/head:pull/3129

PR: https://git.openjdk.java.net/jdk/pull/3129


More information about the compiler-dev mailing list