src/java.base/share/classes/jdk/internal/reflect/UnsafeQualifiedObjectFieldAccessorImpl.java
equal
deleted
inserted
replaced
34 super(field, isReadOnly); |
34 super(field, isReadOnly); |
35 } |
35 } |
36 |
36 |
37 public Object get(Object obj) throws IllegalArgumentException { |
37 public Object get(Object obj) throws IllegalArgumentException { |
38 ensureObj(obj); |
38 ensureObj(obj); |
39 return unsafe.getObjectVolatile(obj, fieldOffset); |
39 return unsafe.getReferenceVolatile(obj, fieldOffset); |
40 } |
40 } |
41 |
41 |
42 public boolean getBoolean(Object obj) throws IllegalArgumentException { |
42 public boolean getBoolean(Object obj) throws IllegalArgumentException { |
43 throw newGetBooleanIllegalArgumentException(); |
43 throw newGetBooleanIllegalArgumentException(); |
44 } |
44 } |
81 if (value != null) { |
81 if (value != null) { |
82 if (!field.getType().isAssignableFrom(value.getClass())) { |
82 if (!field.getType().isAssignableFrom(value.getClass())) { |
83 throwSetIllegalArgumentException(value); |
83 throwSetIllegalArgumentException(value); |
84 } |
84 } |
85 } |
85 } |
86 unsafe.putObjectVolatile(obj, fieldOffset, value); |
86 unsafe.putReferenceVolatile(obj, fieldOffset, value); |
87 } |
87 } |
88 |
88 |
89 public void setBoolean(Object obj, boolean z) |
89 public void setBoolean(Object obj, boolean z) |
90 throws IllegalArgumentException, IllegalAccessException |
90 throws IllegalArgumentException, IllegalAccessException |
91 { |
91 { |