You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2009/10/25 12:07:58 UTC

svn commit: r829535 - in /commons/proper/lang/trunk/src/test/org/apache/commons/lang/reflect: FieldUtilsTest.java MethodUtilsTest.java

Author: sebb
Date: Sun Oct 25 11:07:57 2009
New Revision: 829535

URL: http://svn.apache.org/viewvc?rev=829535&view=rev
Log:
Fix some raw types

Modified:
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/reflect/FieldUtilsTest.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/reflect/MethodUtilsTest.java

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/reflect/FieldUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/reflect/FieldUtilsTest.java?rev=829535&r1=829534&r2=829535&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/reflect/FieldUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/reflect/FieldUtilsTest.java Sun Oct 25 11:07:57 2009
@@ -47,7 +47,7 @@
     private PublicChild publicChild;
     private PubliclyShadowedChild publiclyShadowedChild;
     private PrivatelyShadowedChild privatelyShadowedChild;
-    private Class parentClass = PublicChild.class.getSuperclass();
+    private Class<?> parentClass = PublicChild.class.getSuperclass();
 
     /**
      * Run the test cases as a suite.

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/reflect/MethodUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/reflect/MethodUtilsTest.java?rev=829535&r1=829534&r2=829535&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/reflect/MethodUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/reflect/MethodUtilsTest.java Sun Oct 25 11:07:57 2009
@@ -97,11 +97,11 @@
     }
 
     private TestBean testBean;
-    private Map classCache;
+    private Map<Class<?>, Class<?>[]> classCache;
 
     public MethodUtilsTest(String name) {
         super(name);
-        classCache = new HashMap();
+        classCache = new HashMap<Class<?>, Class<?>[]>();
     }
 
     /**
@@ -238,7 +238,7 @@
 
     public void testGetAccessibleInterfaceMethod() throws Exception {
 
-        Class[][] p = { ArrayUtils.EMPTY_CLASS_ARRAY, null };
+        Class<?>[][] p = { ArrayUtils.EMPTY_CLASS_ARRAY, null };
         for (int i = 0; i < p.length; i++) {
             Method method = TestMutable.class.getMethod("getValue", p[i]);
             Method accessibleMethod = MethodUtils.getAccessibleMethod(method);
@@ -249,7 +249,7 @@
 
     public void testGetAccessibleInterfaceMethodFromDescription()
             throws Exception {
-        Class[][] p = { ArrayUtils.EMPTY_CLASS_ARRAY, null };
+        Class<?>[][] p = { ArrayUtils.EMPTY_CLASS_ARRAY, null };
         for (int i = 0; i < p.length; i++) {
             Method accessibleMethod = MethodUtils.getAccessibleMethod(
                     TestMutable.class, "getValue", p[i]);
@@ -310,8 +310,8 @@
                 singletonArray(Double.TYPE), singletonArray(Double.TYPE));
     }
 
-    private void expectMatchingAccessibleMethodParameterTypes(Class cls,
-            String methodName, Class[] requestTypes, Class[] actualTypes) {
+    private void expectMatchingAccessibleMethodParameterTypes(Class<?> cls,
+            String methodName, Class<?>[] requestTypes, Class<?>[] actualTypes) {
         Method m = MethodUtils.getMatchingAccessibleMethod(cls, methodName,
                 requestTypes);
         assertTrue(toString(m.getParameterTypes()) + " not equals "
@@ -319,12 +319,12 @@
                 .getParameterTypes()));
     }
 
-    private String toString(Class[] c) {
+    private String toString(Class<?>[] c) {
         return Arrays.asList(c).toString();
     }
 
-    private Class[] singletonArray(Class c) {
-        Class[] result = (Class[]) classCache.get(c);
+    private Class<?>[] singletonArray(Class<?> c) {
+        Class<?>[] result = classCache.get(c);
         if (result == null) {
             result = new Class[] { c };
             classCache.put(c, result);