aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/util
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-03-04 21:05:08 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-03-04 21:05:08 +0000
commit94f842fa9223d1d0fa233266495a20a00eafa030 (patch)
tree76563fe6342b4dd540651491776f331e02068344 /src/Java/gtPlusPlus/core/util
parentaf27ff015c4197bb5a6ddb7dd38769f8950a4ac9 (diff)
downloadGT5-Unofficial-94f842fa9223d1d0fa233266495a20a00eafa030.tar.gz
GT5-Unofficial-94f842fa9223d1d0fa233266495a20a00eafa030.tar.bz2
GT5-Unofficial-94f842fa9223d1d0fa233266495a20a00eafa030.zip
% Final touches to TC aspects. The 5 custom ones added by GT++ now have names and proper handling.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util')
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 617728cdec..722a4f3ff7 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -107,6 +107,9 @@ public class ReflectionUtils {
* @return - Valid, {@link Class} object, or {@link null}.
*/
public static Class getClass(String aClassCanonicalName) {
+ if (aClassCanonicalName == null || aClassCanonicalName.length() <= 0) {
+ return null;
+ }
Class y = mCachedClasses.get(aClassCanonicalName);
if (y == null) {
y = getClass_Internal(aClassCanonicalName);
@@ -140,6 +143,9 @@ public class ReflectionUtils {
* @return - Valid, non-final, {@link Method} object, or {@link null}.
*/
public static Method getMethod(Class aClass, String aMethodName, Class... aTypes) {
+ if (aClass == null || aMethodName == null || aMethodName.length() <= 0) {
+ return null;
+ }
String aMethodKey = ArrayUtils.toString(aTypes);
//Logger.REFLECTION("Looking up method in cache: "+(aClass.getName()+"."+aMethodName + "." + aMethodKey));
CachedMethod y = mCachedMethods.get(aClass.getName()+"."+aMethodName + "." + aMethodKey);
@@ -166,6 +172,9 @@ public class ReflectionUtils {
* @return - Valid, non-final, {@link Field} object, or {@link null}.
*/
public static Field getField(final Class aClass, final String aFieldName) {
+ if (aClass == null || aFieldName == null || aFieldName.length() <= 0) {
+ return null;
+ }
CachedField y = mCachedFields.get(aClass.getName()+"."+aFieldName);
if (y == null) {
Field u;