[trivial]

This commit is contained in:
Reinier Zwitserloot committed 2025-03-30 00:25:00 +01:00
1 parent f158f2c241
commit 02cb2834fb
1 file changed
+5 -6
+5 -6
View File
@@ -132,16 +132,15 @@ public class Permit {
public static Field getField(Class<?> c, String fName) throws NoSuchFieldException {
Field f = null;
Class<?> oc = c;
while (c != null) {
Class<?> d = c;
while (d != null) {
try {
f = c.getDeclaredField(fName);
f = d.getDeclaredField(fName);
break;
} catch (NoSuchFieldException e) {}
c = c.getSuperclass();
d = d.getSuperclass();
}
if (f == null) throw new NoSuchFieldException(oc.getName() + " :: " + fName);
if (f == null) throw new NoSuchFieldException(c.getName() + " :: " + fName);
return setAccessible(f);
}