From 5d6a3acb74c631bd4e16cb5195ae9e71be006488 Mon Sep 17 00:00:00 2001 From: aclement Date: Sat, 7 May 2011 22:02:53 +0000 Subject: [PATCH] generics --- util/src/org/aspectj/util/Reflection.java | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/util/src/org/aspectj/util/Reflection.java b/util/src/org/aspectj/util/Reflection.java index 575caa665..83ceaac23 100644 --- a/util/src/org/aspectj/util/Reflection.java +++ b/util/src/org/aspectj/util/Reflection.java @@ -21,25 +21,25 @@ import java.util.ArrayList; //import java.util.StringTokenizer; public class Reflection { - public static final Class[] MAIN_PARM_TYPES = new Class[] {String[].class}; + public static final Class[] MAIN_PARM_TYPES = new Class[] {String[].class}; private Reflection() { } - public static Object invokestaticN(Class class_, String name, Object[] args) { + public static Object invokestaticN(Class class_, String name, Object[] args) { return invokeN(class_, name, null, args); } - public static Object invoke(Class class_, Object target, String name, Object arg1, Object arg2) { + public static Object invoke(Class class_, Object target, String name, Object arg1, Object arg2) { return invokeN(class_, name, target, new Object[] { arg1, arg2 }); } - public static Object invoke(Class class_, Object target, String name, Object arg1, Object arg2, Object arg3) { + public static Object invoke(Class class_, Object target, String name, Object arg1, Object arg2, Object arg3) { return invokeN(class_, name, target, new Object[] { arg1, arg2, arg3 }); } - public static Object invokeN(Class class_, String name, Object target, Object[] args) { + public static Object invokeN(Class class_, String name, Object target, Object[] args) { Method meth = getMatchingMethod(class_, name, args); try { return meth.invoke(target, args); @@ -55,7 +55,7 @@ public class Reflection { } - public static Method getMatchingMethod(Class class_, String name, Object[] args) { + public static Method getMatchingMethod(Class class_, String name, Object[] args) { Method[] meths = class_.getMethods(); for (int i=0; i < meths.length; i++) { Method meth = meths[i]; @@ -74,7 +74,7 @@ public class Reflection { - public static Object getStaticField(Class class_, String name) { + public static Object getStaticField(Class class_, String name) { try { return class_.getField(name).get(null); } catch (IllegalAccessException e) { @@ -93,13 +93,13 @@ public class Reflection { InvocationTargetException, ClassNotFoundException { LangUtil.throwIaxIfNull(className, "class name"); if (LangUtil.isEmpty(classpath)) { - Class mainClass = Class.forName(className); + Class mainClass = Class.forName(className); runMainInSameVM(mainClass, args); return; } - ArrayList dirs = new ArrayList(); - ArrayList libs = new ArrayList(); - ArrayList urls = new ArrayList(); + ArrayList dirs = new ArrayList(); + ArrayList libs = new ArrayList(); + ArrayList urls = new ArrayList(); String[] entries = LangUtil.splitClasspath(classpath); for (int i = 0; i < entries.length; i++) { String entry = entries[i]; @@ -150,7 +150,7 @@ public class Reflection { } } UtilClassLoader loader = new UtilClassLoader(urls, dirs); - Class targetClass = null; + Class targetClass = null; try { targetClass = loader.loadClass(className); } catch (ClassNotFoundException e) { @@ -162,7 +162,7 @@ public class Reflection { main.invoke(null, new Object[] { args }); } - public static void runMainInSameVM(Class mainClass, String[] args) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { + public static void runMainInSameVM(Class mainClass, String[] args) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException { LangUtil.throwIaxIfNull(mainClass, "main class"); Method main = mainClass.getMethod("main", MAIN_PARM_TYPES); main.invoke(null, new Object[] { args }); -- 2.39.5