From e733ec9759368981c39f5e494551b17ce020de30 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Mon, 7 Aug 2017 05:02:29 +0000 Subject: $ Fixed byte setting method in ReflectionUtils.java --- src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/Java/gtPlusPlus/core') diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index fb8c37db4d..dd3adac3bc 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -145,13 +145,7 @@ public class ReflectionUtils { } - - - - /** - * Allows to change the state of an immutable instance. Huh?!? - */ - public static void setByte(Class clazz, String fieldName, Byte newValue) throws Exception { + public static void setByte(Class clazz, String fieldName, byte newValue) throws Exception { /*Field nameField = getField(clazz, fieldName); nameField.setAccessible(true); int modifiers = nameField.getModifiers(); @@ -163,7 +157,7 @@ public class ReflectionUtils { final Field fieldA = clazz.getDeclaredField(fieldName); fieldA.setAccessible( true ); - fieldA.setInt(clazz, newValue ); + fieldA.setByte(clazz, newValue ); } -- cgit