[util] get rid of explicit reference to internal Unsafe class in ConcurrentHashMap
authorNikolay Chashnikov <Nikolay.Chashnikov@jetbrains.com>
Thu, 13 Aug 2020 15:02:40 +0000 (18:02 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Thu, 13 Aug 2020 16:05:59 +0000 (16:05 +0000)
commit961f17649849f4f368c39fe12406e48b0d0efde0
treeccbf37eddaa5bb92b52c0e33fb1c96dcfcd82cee
parentdbd31afd183f323eb8f7c8cb3894572d89b5d8a1
[util] get rid of explicit reference to internal Unsafe class in ConcurrentHashMap

Use method handle to call its methods instead. This is needed to be able to compile intellij.platform.core.impl module using JDK 11 (IDEA-248086).

The change doesn't affect performance of ConcurrentHashMap much, and anyway we plan to create a variant of it which uses var handles (see IDEA-244473), so this implementation will be used only in places which stay on Java 8.

GitOrigin-RevId: d379a7c747aa720566249d31f16d9d9e0fe13ea5
platform/core-impl/src/com/intellij/concurrency/ConcurrentHashMap.java
platform/platform-tests/testSrc/com/intellij/concurrency/ConcurrentHashMapTest.kt [new file with mode: 0644]