Fixup field cache code

This commit is contained in:
FlorianMichael 2024-04-02 21:01:49 +02:00
parent 5f95c9edd1
commit a155098cb6
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
1 changed files with 4 additions and 1 deletions

View File

@ -75,7 +75,10 @@ public class ReflectionUtil {
if (fieldCache.containsKey(key)) {
return fieldCache.get(key);
} else {
final Field field = failSafeGetField(clazz, fieldName);
Field field = null;
try {
field = clazz.getDeclaredField(fieldName);
} catch (NoSuchFieldException ignored) {} // Cache non-existing field too
fieldCache.put(key, field);
return field;
}