|
|
@@ -34,12 +34,12 @@ public class RField implements IField {
|
|
|
private final Supplier<MethodHandle> setter;
|
|
|
|
|
|
RField(boolean declared, IContext context, Field field) {
|
|
|
- ReflectUtils.access(field);
|
|
|
this.context = context;
|
|
|
this.parent = context.typeinfo(field.getDeclaringClass());
|
|
|
this.field = field;
|
|
|
this.getter = LazyReference.concurrent(() -> {
|
|
|
try {
|
|
|
+ ReflectUtils.access(field);
|
|
|
return MethodHandles.lookup().unreflectGetter(field);
|
|
|
} catch (IllegalAccessException cause) {
|
|
|
throw ExceptionUtils.rethrow(cause);
|
|
|
@@ -47,6 +47,7 @@ public class RField implements IField {
|
|
|
});
|
|
|
this.setter = LazyReference.concurrent(() -> {
|
|
|
try {
|
|
|
+ ReflectUtils.access(field);
|
|
|
return MethodHandles.lookup().unreflectSetter(field);
|
|
|
} catch (IllegalAccessException cause) {
|
|
|
throw ExceptionUtils.rethrow(cause);
|
|
|
@@ -106,6 +107,12 @@ public class RField implements IField {
|
|
|
return field;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public IField accessible() {
|
|
|
+ ReflectUtils.access(field);
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public IField rewritable() {
|
|
|
ReflectUtils.rewritable(field);
|