public static Field getField(Class<?> clazz, String name) throws NoSuchFieldException {
if (!ClassDataStore.instance().isClassReplaced(clazz)) {
return clazz.getField(name);
}
ClassData cd = ClassDataStore.instance().getModifiedClassData(clazz.getClassLoader(), Descriptor.toJvmName(clazz.getName()));
if (cd == null) {
return clazz.getField(name);
}
FieldData fd = cd.getField(name);
if (fd == null) {
return clazz.getField(name);
}
if (!AccessFlag.isPublic(fd.getAccessFlags())) {
throw new NoSuchFieldException(clazz.getName() + "." + name);