--- old/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java 2019-09-14 11:11:56.412913938 -0700 +++ new/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java 2019-09-14 11:11:56.064913695 -0700 @@ -385,7 +385,7 @@ * cases where old nodes can be reused because their next fields * won't change. On average, only about one-sixth of them need * cloning when a table doubles. The nodes they replace will be - * garbage collectable as soon as they are no longer referenced by + * garbage collectible as soon as they are no longer referenced by * any reader thread that may be in the midst of concurrently * traversing table. Upon transfer, the old table bin contains * only a special forwarding node (with hash field "MOVED") that @@ -3286,9 +3286,8 @@ return true; } - private static final Unsafe U = Unsafe.getUnsafe(); private static final long LOCKSTATE - = U.objectFieldOffset(TreeBin.class, "lockState"); + = U.objectFieldOffset(TreeBin.class, "lockState"); } /* ----------------Table Traversal -------------- */ @@ -6345,28 +6344,20 @@ // Unsafe mechanics private static final Unsafe U = Unsafe.getUnsafe(); - private static final long SIZECTL; - private static final long TRANSFERINDEX; - private static final long BASECOUNT; - private static final long CELLSBUSY; - private static final long CELLVALUE; - private static final int ABASE; + private static final long SIZECTL + = U.objectFieldOffset(ConcurrentHashMap.class, "sizeCtl"); + private static final long TRANSFERINDEX + = U.objectFieldOffset(ConcurrentHashMap.class, "transferIndex"); + private static final long BASECOUNT + = U.objectFieldOffset(ConcurrentHashMap.class, "baseCount"); + private static final long CELLSBUSY + = U.objectFieldOffset(ConcurrentHashMap.class, "cellsBusy"); + private static final long CELLVALUE + = U.objectFieldOffset(CounterCell.class, "value"); + private static final int ABASE = U.arrayBaseOffset(Node[].class); private static final int ASHIFT; static { - SIZECTL = U.objectFieldOffset - (ConcurrentHashMap.class, "sizeCtl"); - TRANSFERINDEX = U.objectFieldOffset - (ConcurrentHashMap.class, "transferIndex"); - BASECOUNT = U.objectFieldOffset - (ConcurrentHashMap.class, "baseCount"); - CELLSBUSY = U.objectFieldOffset - (ConcurrentHashMap.class, "cellsBusy"); - - CELLVALUE = U.objectFieldOffset - (CounterCell.class, "value"); - - ABASE = U.arrayBaseOffset(Node[].class); int scale = U.arrayIndexScale(Node[].class); if ((scale & (scale - 1)) != 0) throw new ExceptionInInitializerError("array index scale not a power of two");