< prev index next >
src/java.base/share/classes/jdk/internal/reflect/UnsafeObjectFieldAccessorImpl.java
Print this page
*** 32,42 ****
super(field);
}
public Object get(Object obj) throws IllegalArgumentException {
ensureObj(obj);
! return unsafe.getObject(obj, fieldOffset);
}
public boolean getBoolean(Object obj) throws IllegalArgumentException {
throw newGetBooleanIllegalArgumentException();
}
--- 32,42 ----
super(field);
}
public Object get(Object obj) throws IllegalArgumentException {
ensureObj(obj);
! return unsafe.getReference(obj, fieldOffset);
}
public boolean getBoolean(Object obj) throws IllegalArgumentException {
throw newGetBooleanIllegalArgumentException();
}
*** 79,89 ****
if (value != null) {
if (!field.getType().isAssignableFrom(value.getClass())) {
throwSetIllegalArgumentException(value);
}
}
! unsafe.putObject(obj, fieldOffset, value);
}
public void setBoolean(Object obj, boolean z)
throws IllegalArgumentException, IllegalAccessException
{
--- 79,89 ----
if (value != null) {
if (!field.getType().isAssignableFrom(value.getClass())) {
throwSetIllegalArgumentException(value);
}
}
! unsafe.putReference(obj, fieldOffset, value);
}
public void setBoolean(Object obj, boolean z)
throws IllegalArgumentException, IllegalAccessException
{
< prev index next >