@@ -55,7 +55,10 @@ final class FieldInfo extends DynamicObjectFieldLocation implements Comparable<F
5555 private static final boolean JDK21 = Runtime .version ().feature () == 21 ;
5656 private static final int UNUSED_OFFSET = 0 ;
5757
58- /** Field offset. Used by AtomicFieldUpdaterOffset recomputation. Do not rename! */
58+ /**
59+ * Field offset. Used by AtomicFieldUpdaterOffset recomputation. Do not rename! On JDK21 this is
60+ * 0, so always use {@link #offset()} instead of this field directly.
61+ */
5962 private final long offset ;
6063 /** Declaring class. Used by AtomicFieldUpdaterOffset recomputation. Do not rename! */
6164 private final Class <? extends DynamicObject > tclass ;
@@ -116,19 +119,19 @@ public String name() {
116119
117120 @ Override
118121 public String toString () {
119- return name + ":" + offset ;
122+ return name + ":" + offset () ;
120123 }
121124
122125 @ Override
123126 public int compareTo (FieldInfo other ) {
124- return Long .compare (this .offset , other .offset );
127+ return Long .compare (this .offset () , other .offset () );
125128 }
126129
127130 @ Override
128131 public int hashCode () {
129132 final int prime = 31 ;
130133 int result = 1 ;
131- result = prime * result + Long .hashCode (offset );
134+ result = prime * result + Long .hashCode (offset () );
132135 result = prime * result + tclass .hashCode ();
133136 return result ;
134137 }
@@ -141,7 +144,7 @@ public boolean equals(Object obj) {
141144 if (!(obj instanceof FieldInfo other )) {
142145 return false ;
143146 }
144- return this .offset == other .offset && this .tclass == other .tclass ;
147+ return this .offset () == other .offset () && this .tclass == other .tclass ;
145148 }
146149
147150 void receiverCheck (DynamicObject store ) {
0 commit comments