Author: sebb Date: Sat Oct 24 13:37:46 2009 New Revision: 829364 URL: http://svn.apache.org/viewvc?rev=829364&view=rev Log: Fix raw Class types
Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/reflect/MethodUtils.java Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/reflect/MethodUtils.java URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/reflect/MethodUtils.java?rev=829364&r1=829363&r2=829364&view=diff ============================================================================== --- commons/proper/lang/trunk/src/java/org/apache/commons/lang/reflect/MethodUtils.java (original) +++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/reflect/MethodUtils.java Sat Oct 24 13:37:46 2009 @@ -124,7 +124,7 @@ args = ArrayUtils.EMPTY_OBJECT_ARRAY; } int arguments = args.length; - Class[] parameterTypes = new Class[arguments]; + Class<?>[] parameterTypes = new Class[arguments]; for (int i = 0; i < arguments; i++) { parameterTypes[i] = args[i].getClass(); } @@ -151,7 +151,7 @@ * @throws IllegalAccessException if the requested method is not accessible via reflection */ public static Object invokeMethod(Object object, String methodName, - Object[] args, Class[] parameterTypes) + Object[] args, Class<?>[] parameterTypes) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { if (parameterTypes == null) { @@ -220,7 +220,7 @@ args = ArrayUtils.EMPTY_OBJECT_ARRAY; } int arguments = args.length; - Class[] parameterTypes = new Class[arguments]; + Class<?>[] parameterTypes = new Class[arguments]; for (int i = 0; i < arguments; i++) { parameterTypes[i] = args[i].getClass(); } @@ -247,7 +247,7 @@ * via reflection */ public static Object invokeExactMethod(Object object, String methodName, - Object[] args, Class[] parameterTypes) + Object[] args, Class<?>[] parameterTypes) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { if (args == null) { @@ -285,8 +285,8 @@ * @throws IllegalAccessException if the requested method is not accessible * via reflection */ - public static Object invokeExactStaticMethod(Class cls, String methodName, - Object[] args, Class[] parameterTypes) + public static Object invokeExactStaticMethod(Class<?> cls, String methodName, + Object[] args, Class<?>[] parameterTypes) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { if (args == null) { @@ -327,7 +327,7 @@ * @throws IllegalAccessException if the requested method is not accessible * via reflection */ - public static Object invokeStaticMethod(Class cls, String methodName, + public static Object invokeStaticMethod(Class<?> cls, String methodName, Object arg) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { return invokeStaticMethod(cls, methodName, new Object[] { arg }); @@ -357,14 +357,14 @@ * @throws IllegalAccessException if the requested method is not accessible * via reflection */ - public static Object invokeStaticMethod(Class cls, String methodName, + public static Object invokeStaticMethod(Class<?> cls, String methodName, Object[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { if (args == null) { args = ArrayUtils.EMPTY_OBJECT_ARRAY; } int arguments = args.length; - Class[] parameterTypes = new Class[arguments]; + Class<?>[] parameterTypes = new Class[arguments]; for (int i = 0; i < arguments; i++) { parameterTypes[i] = args[i].getClass(); } @@ -393,8 +393,8 @@ * @throws IllegalAccessException if the requested method is not accessible * via reflection */ - public static Object invokeStaticMethod(Class cls, String methodName, - Object[] args, Class[] parameterTypes) + public static Object invokeStaticMethod(Class<?> cls, String methodName, + Object[] args, Class<?>[] parameterTypes) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { if (parameterTypes == null) { @@ -431,7 +431,7 @@ * @throws IllegalAccessException if the requested method is not accessible * via reflection */ - public static Object invokeExactStaticMethod(Class cls, String methodName, + public static Object invokeExactStaticMethod(Class<?> cls, String methodName, Object arg) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { return invokeExactStaticMethod(cls, methodName, new Object[] { arg }); @@ -455,14 +455,14 @@ * @throws IllegalAccessException if the requested method is not accessible * via reflection */ - public static Object invokeExactStaticMethod(Class cls, String methodName, + public static Object invokeExactStaticMethod(Class<?> cls, String methodName, Object[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { if (args == null) { args = ArrayUtils.EMPTY_OBJECT_ARRAY; } int arguments = args.length; - Class[] parameterTypes = new Class[arguments]; + Class<?>[] parameterTypes = new Class[arguments]; for (int i = 0; i < arguments; i++) { parameterTypes[i] = args[i].getClass(); } @@ -481,10 +481,10 @@ * @param parameterType taking this type of parameter * @return The accessible method */ - public static Method getAccessibleMethod(Class cls, String methodName, - Class parameterType) { + public static Method getAccessibleMethod(Class<?> cls, String methodName, + Class<?> parameterType) { return getAccessibleMethod(cls, methodName, - new Class[] { parameterType }); + new Class<?>[] { parameterType }); } /** @@ -499,8 +499,8 @@ * @param parameterTypes with these parameters types * @return The accessible method */ - public static Method getAccessibleMethod(Class cls, String methodName, - Class[] parameterTypes) { + public static Method getAccessibleMethod(Class<?> cls, String methodName, + Class<?>[] parameterTypes) { try { return getAccessibleMethod(cls.getMethod(methodName, parameterTypes)); @@ -522,12 +522,12 @@ return null; } // If the declaring class is public, we are done - Class cls = method.getDeclaringClass(); + Class<?> cls = method.getDeclaringClass(); if (Modifier.isPublic(cls.getModifiers())) { return method; } String methodName = method.getName(); - Class[] parameterTypes = method.getParameterTypes(); + Class<?>[] parameterTypes = method.getParameterTypes(); // Check the implemented interfaces and subinterfaces method = getAccessibleMethodFromInterfaceNest(cls, methodName, @@ -550,9 +550,9 @@ * @param methodName Method name of the method we wish to call * @param parameterTypes The parameter type signatures */ - private static Method getAccessibleMethodFromSuperclass(Class cls, - String methodName, Class[] parameterTypes) { - Class parentClass = cls.getSuperclass(); + private static Method getAccessibleMethodFromSuperclass(Class<?> cls, + String methodName, Class<?>[] parameterTypes) { + Class<?> parentClass = cls.getSuperclass(); while (parentClass != null) { if (Modifier.isPublic(parentClass.getModifiers())) { try { @@ -580,15 +580,15 @@ * @param methodName Method name of the method we wish to call * @param parameterTypes The parameter type signatures */ - private static Method getAccessibleMethodFromInterfaceNest(Class cls, - String methodName, Class[] parameterTypes) { + private static Method getAccessibleMethodFromInterfaceNest(Class<?> cls, + String methodName, Class<?>[] parameterTypes) { Method method = null; // Search up the superclass chain for (; cls != null; cls = cls.getSuperclass()) { // Check the implemented interfaces of the parent class - Class[] interfaces = cls.getInterfaces(); + Class<?>[] interfaces = cls.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { // Is this interface public? if (!Modifier.isPublic(interfaces[i].getModifiers())) { @@ -638,8 +638,8 @@ * @param parameterTypes find method with most compatible parameters * @return The accessible method */ - public static Method getMatchingAccessibleMethod(Class cls, - String methodName, Class[] parameterTypes) { + public static Method getMatchingAccessibleMethod(Class<?> cls, + String methodName, Class<?>[] parameterTypes) { try { Method method = cls.getMethod(methodName, parameterTypes); MemberUtils.setAccessibleWorkaround(method);