< prev index next >

src/java.base/share/classes/java/lang/invoke/VarHandle.java

Print this page

        

@@ -1549,10 +1549,15 @@
 
         MethodType accessModeType(Class<?> receiver, Class<?> value,
                                   Class<?>... intermediate) {
             Class<?>[] ps;
             int i;
+            // the field type (value) is mapped to the return type of MethodType
+            // the receiver type is mapped to a parameter type of MethodType
+            // So use the value type as receiver may be a box type.
+            if (receiver != null && receiver.isInlineClass())
+                receiver = receiver.asPrimaryType();
             switch (this) {
                 case GET:
                     ps = allocateParameters(0, receiver, intermediate);
                     fillParameters(ps, receiver, intermediate);
                     return MethodType.methodType(value, ps);
< prev index next >