diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-07 17:54:21 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-07 17:54:21 +0000 |
commit | 680fef1a0f49d8706fd58093da63a2d9438d0641 (patch) | |
tree | 22f1da8e3cb9177e399ef68842c1e6ca7f1298e9 /src/Java/gtPlusPlus/core/util | |
parent | a4779df4755d9312936529aca3de1297fed7a904 (diff) | |
download | GT5-Unofficial-680fef1a0f49d8706fd58093da63a2d9438d0641.tar.gz GT5-Unofficial-680fef1a0f49d8706fd58093da63a2d9438d0641.tar.bz2 GT5-Unofficial-680fef1a0f49d8706fd58093da63a2d9438d0641.zip |
More minor fixes.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index e0634dfb14..1ef925f793 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -432,6 +432,18 @@ public class ReflectionUtils { t.printStackTrace(); } } + + /** + * Allows to change the state of an immutable instance. Huh?!? + */ + public static void setFinalFieldValue(Class<?> clazz, Field field, Object newValue) { + try { + setFieldValue_Internal(clazz, field, newValue); + } + catch (Throwable t) { + t.printStackTrace(); + } + } @Deprecated public static void setFinalStatic(Field field, Object newValue) throws Exception { |