src/java.base/share/classes/jdk/internal/reflect/UnsafeQualifiedStaticObjectFieldAccessorImpl.java
equal
deleted
inserted
replaced
33 UnsafeQualifiedStaticObjectFieldAccessorImpl(Field field, boolean isReadOnly) { |
33 UnsafeQualifiedStaticObjectFieldAccessorImpl(Field field, boolean isReadOnly) { |
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 return unsafe.getObjectVolatile(base, fieldOffset); |
38 return unsafe.getReferenceVolatile(base, fieldOffset); |
39 } |
39 } |
40 |
40 |
41 public boolean getBoolean(Object obj) throws IllegalArgumentException { |
41 public boolean getBoolean(Object obj) throws IllegalArgumentException { |
42 throw newGetBooleanIllegalArgumentException(); |
42 throw newGetBooleanIllegalArgumentException(); |
43 } |
43 } |
79 if (value != null) { |
79 if (value != null) { |
80 if (!field.getType().isAssignableFrom(value.getClass())) { |
80 if (!field.getType().isAssignableFrom(value.getClass())) { |
81 throwSetIllegalArgumentException(value); |
81 throwSetIllegalArgumentException(value); |
82 } |
82 } |
83 } |
83 } |
84 unsafe.putObjectVolatile(base, fieldOffset, value); |
84 unsafe.putReferenceVolatile(base, fieldOffset, value); |
85 } |
85 } |
86 |
86 |
87 public void setBoolean(Object obj, boolean z) |
87 public void setBoolean(Object obj, boolean z) |
88 throws IllegalArgumentException, IllegalAccessException |
88 throws IllegalArgumentException, IllegalAccessException |
89 { |
89 { |