if (asWriter) {
if (isFinal) throw context.getRuntime().newSecurityError("Cannot change final field '" + field.getName() + "'");
module.getSingletonClass().addMethod(asName + "=", new StaticFieldSetter(key, module, field));
}
} else {
if (asReader) module.addMethod(asName, new InstanceFieldGetter(key, module, field));
if (asWriter) {
if (isFinal) throw context.getRuntime().newSecurityError("Cannot change final field '" + field.getName() + "'");
module.addMethod(asName + "=", new InstanceFieldSetter(key, module, field));
}
}