On Wed, 1 Feb 2023 11:37:16 GMT, Per Minborg <pminb...@openjdk.org> wrote:
>> src/java.base/share/classes/java/time/ZoneOffset.java line 147: >> >>> 145: >>> 146: /** Cache of time-zone offset by offset in seconds [-18h, +18h] >>> for each even quarter of an hour. */ >>> 147: private static final AtomicReferenceArray<ZoneOffset> >>> SECONDS_CACHE = new AtomicReferenceArray<>(MAX_SECONDS_CACHE_SLOT * 2 + 1); >> >> Can we use regular array instead? > > We can but that entails special handling to ensure thread-safety. I will > provide such a solution. Thanks. If you need the thread-safety, perhaps sticking with `AtomicReferenceArray` is a simpler solution than the regular array one. ------------- PR: https://git.openjdk.org/jdk/pull/12346