aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-04-24 13:35:04 +1000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-04-24 13:35:04 +1000
commitac3715298f2405ea9fb45bc79bd48f1851dd28aa (patch)
tree218ee422c07bedeeac0e3acf4b74d1e8cbb49b8e /src/Java/gtPlusPlus/core
parent7c9f6372fcff2877474a184fce49622710d82fb7 (diff)
downloadGT5-Unofficial-ac3715298f2405ea9fb45bc79bd48f1851dd28aa.tar.gz
GT5-Unofficial-ac3715298f2405ea9fb45bc79bd48f1851dd28aa.tar.bz2
GT5-Unofficial-ac3715298f2405ea9fb45bc79bd48f1851dd28aa.zip
$ Fixed StackOverflow, caused by my negligence to realise this was the base class lookup function.
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index ef55792c63..722a4f3ff7 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -463,11 +463,13 @@ public class ReflectionUtils {
* therefore no more risk of code throwing NoClassDefFoundException.
*/
private static boolean isClassPresent(final String className) {
- if (getClass(className) != null) {
- return true;
+ try {
+ Class.forName(className);
+ return true;
+ } catch (final Throwable ex) {
+ // Class or one of its dependencies is not present...
+ return false;
}
- // Class or one of its dependencies is not present...
- return false;
}
@Deprecated