< prev index next >

src/java.base/share/classes/jdk/internal/reflect/UnsafeStaticObjectFieldAccessorImpl.java

Print this page

        

*** 31,41 **** UnsafeStaticObjectFieldAccessorImpl(Field field) { super(field); } public Object get(Object obj) throws IllegalArgumentException { ! return isFlatValue() ? unsafe.getValue(base, fieldOffset, field.getType()) : unsafe.getReference(base, fieldOffset); } public boolean getBoolean(Object obj) throws IllegalArgumentException { throw newGetBooleanIllegalArgumentException(); --- 31,41 ---- UnsafeStaticObjectFieldAccessorImpl(Field field) { super(field); } public Object get(Object obj) throws IllegalArgumentException { ! return isFlattened() ? unsafe.getValue(base, fieldOffset, field.getType()) : unsafe.getReference(base, fieldOffset); } public boolean getBoolean(Object obj) throws IllegalArgumentException { throw newGetBooleanIllegalArgumentException();
*** 74,84 **** { if (isFinal) { throwFinalFieldIllegalAccessException(value); } checkValue(value); ! if (isFlatValue()) { unsafe.putValue(obj, fieldOffset, field.getType(), value); } else { unsafe.putReference(base, fieldOffset, value); } } --- 74,84 ---- { if (isFinal) { throwFinalFieldIllegalAccessException(value); } checkValue(value); ! if (isFlattened()) { unsafe.putValue(obj, fieldOffset, field.getType(), value); } else { unsafe.putReference(base, fieldOffset, value); } }
< prev index next >