src/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java

Print this page

        

@@ -38,21 +38,21 @@
  *
  * @author  Josh Bloch
  * @since   1.5
  */
 class AnnotationInvocationHandler implements InvocationHandler, Serializable {
-    private final Class type;
+    private final Class<? extends Annotation> type;
     private final Map<String, Object> memberValues;
 
-    AnnotationInvocationHandler(Class type, Map<String, Object> memberValues) {
+    AnnotationInvocationHandler(Class<? extends Annotation> type, Map<String, Object> memberValues) {
         this.type = type;
         this.memberValues = memberValues;
     }
 
     public Object invoke(Object proxy, Method method, Object[] args) {
         String member = method.getName();
-        Class[] paramTypes = method.getParameterTypes();
+        Class<?>[] paramTypes = method.getParameterTypes();
 
         // Handle Object and Annotation methods
         if (member.equals("equals") && paramTypes.length == 1 &&
             paramTypes[0] == Object.class)
             return equalsImpl(args[0]);

@@ -82,11 +82,11 @@
     /**
      * This method, which clones its array argument, would not be necessary
      * if Cloneable had a public clone method.
      */
     private Object cloneArray(Object array) {
-        Class type = array.getClass();
+        Class<?> type = array.getClass();
 
         if (type == byte[].class) {
             byte[] byteArray = (byte[])array;
             return byteArray.clone();
         }

@@ -149,11 +149,11 @@
 
     /**
      * Translates a member value (in "dynamic proxy return form") into a string
      */
     private static String memberValueToString(Object value) {
-        Class type = value.getClass();
+        Class<?> type = value.getClass();
         if (!type.isArray())    // primitive, string, class, enum const,
                                 // or annotation
             return value.toString();
 
         if (type == byte[].class)

@@ -227,11 +227,11 @@
      * the containing annotations is ill-formed.  If one of the containing
      * annotations is ill-formed, this method will return false unless the
      * two members are identical object references.
      */
     private static boolean memberValueEquals(Object v1, Object v2) {
-        Class type = v1.getClass();
+        Class<?> type = v1.getClass();
 
         // Check for primitive, string, class, enum const, annotation,
         // or ExceptionProxy
         if (!type.isArray())
             return v1.equals(v2);

@@ -299,11 +299,11 @@
 
     /**
      * Computes hashCode of a member value (in "dynamic proxy return form")
      */
     private static int memberValueHashCode(Object value) {
-        Class type = value.getClass();
+        Class<?> type = value.getClass();
         if (!type.isArray())    // primitive, string, class, enum const,
                                 // or annotation
             return value.hashCode();
 
         if (type == byte[].class)

@@ -338,15 +338,15 @@
         } catch(IllegalArgumentException e) {
             // Class is no longer an annotation type; all bets are off
             return;
         }
 
-        Map<String, Class> memberTypes = annotationType.memberTypes();
+        Map<String, Class<?>> memberTypes = annotationType.memberTypes();
 
         for (Map.Entry<String, Object> memberValue : memberValues.entrySet()) {
             String name = memberValue.getKey();
-            Class memberType = memberTypes.get(name);
+            Class<?> memberType = memberTypes.get(name);
             if (memberType != null) {  // i.e. member still exists
                 Object value = memberValue.getValue();
                 if (!(memberType.isInstance(value) ||
                       value instanceof ExceptionProxy)) {
                     memberValue.setValue(