mirror of
https://github.com/ViaVersion/ViaRewind-Legacy-Support.git
synced 2025-01-24 21:21:50 +01:00
Fixup field cache code
This commit is contained in:
parent
5f95c9edd1
commit
a155098cb6
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user