From 7a1c92118a53b5bc6294d65361e16c5859597a10 Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Wed, 31 Jan 2018 22:16:31 +1000 Subject: $ Finished ASM for getDrops() GT fix. % Mild re-arrangement to CI.java. --- src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Java/gtPlusPlus/core/util') diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index 2a98f0a75a..a0968fd5c1 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -16,14 +16,16 @@ public class ReflectionUtils { public static Field getField(final Class clazz, final String fieldName) throws NoSuchFieldException { try { - return clazz.getDeclaredField(fieldName); + Field k = clazz.getDeclaredField(fieldName); + makeAccessible(k); + return k; } catch (final NoSuchFieldException e) { final Class superClass = clazz.getSuperclass(); if (superClass == null) { - //Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within "+clazz.getCanonicalName()+"."); + Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within "+clazz.getCanonicalName()+"."); throw e; } - //Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within "+clazz.getCanonicalName()+". Trying super class."); + Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within "+clazz.getCanonicalName()+". Trying super class."); return getField(superClass, fieldName); } } -- cgit