src/java.base/share/classes/jdk/internal/reflect/UnsafeObjectFieldAccessorImpl.java
equal
deleted
inserted
replaced
32 super(field); |
32 super(field); |
33 } |
33 } |
34 |
34 |
35 public Object get(Object obj) throws IllegalArgumentException { |
35 public Object get(Object obj) throws IllegalArgumentException { |
36 ensureObj(obj); |
36 ensureObj(obj); |
37 return unsafe.getObject(obj, fieldOffset); |
37 return unsafe.getReference(obj, fieldOffset); |
38 } |
38 } |
39 |
39 |
40 public boolean getBoolean(Object obj) throws IllegalArgumentException { |
40 public boolean getBoolean(Object obj) throws IllegalArgumentException { |
41 throw newGetBooleanIllegalArgumentException(); |
41 throw newGetBooleanIllegalArgumentException(); |
42 } |
42 } |
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.putObject(obj, fieldOffset, value); |
84 unsafe.putReference(obj, 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 { |