jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java
changeset 11120 f8576c769572
parent 6657 15dbb366c6a3
child 13356 89a34c00fd8c
--- a/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Thu Dec 01 11:09:54 2011 +0000
+++ b/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Thu Dec 01 18:34:23 2011 +0000
@@ -40,7 +40,7 @@
 
 public class IndexedPropertyDescriptor extends PropertyDescriptor {
 
-    private Reference<Class> indexedPropertyTypeRef;
+    private Reference<? extends Class<?>> indexedPropertyTypeRef;
     private Reference<Method> indexedReadMethodRef;
     private Reference<Method> indexedWriteMethodRef;
 
@@ -175,14 +175,14 @@
     public synchronized Method getIndexedReadMethod() {
         Method indexedReadMethod = getIndexedReadMethod0();
         if (indexedReadMethod == null) {
-            Class cls = getClass0();
+            Class<?> cls = getClass0();
             if (cls == null ||
                 (indexedReadMethodName == null && indexedReadMethodRef == null)) {
                 // the Indexed readMethod was explicitly set to null.
                 return null;
             }
             if (indexedReadMethodName == null) {
-                Class type = getIndexedPropertyType0();
+                Class<?> type = getIndexedPropertyType0();
                 if (type == boolean.class || type == null) {
                     indexedReadMethodName = Introspector.IS_PREFIX + getBaseName();
                 } else {
@@ -190,7 +190,7 @@
                 }
             }
 
-            Class[] args = { int.class };
+            Class<?>[] args = { int.class };
             indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName, 1, args);
             if (indexedReadMethod == null) {
                 // no "is" method, so look for a "get" method.
@@ -240,7 +240,7 @@
     public synchronized Method getIndexedWriteMethod() {
         Method indexedWriteMethod = getIndexedWriteMethod0();
         if (indexedWriteMethod == null) {
-            Class cls = getClass0();
+            Class<?> cls = getClass0();
             if (cls == null ||
                 (indexedWriteMethodName == null && indexedWriteMethodRef == null)) {
                 // the Indexed writeMethod was explicitly set to null.
@@ -250,14 +250,14 @@
             // We need the indexed type to ensure that we get the correct method.
             // Cannot use the getIndexedPropertyType method since that could
             // result in an infinite loop.
-            Class type = getIndexedPropertyType0();
+            Class<?> type = getIndexedPropertyType0();
             if (type == null) {
                 try {
                     type = findIndexedPropertyType(getIndexedReadMethod(), null);
                     setIndexedPropertyType(type);
                 } catch (IntrospectionException ex) {
                     // Set iprop type to be the classic type
-                    Class propType = getPropertyType();
+                    Class<?> propType = getPropertyType();
                     if (propType.isArray()) {
                         type = propType.getComponentType();
                     }
@@ -268,7 +268,7 @@
                 indexedWriteMethodName = Introspector.SET_PREFIX + getBaseName();
             }
 
-            Class[] args = (type == null) ? null : new Class[] { int.class, type };
+            Class<?>[] args = (type == null) ? null : new Class<?>[] { int.class, type };
             indexedWriteMethod = Introspector.findMethod(cls, indexedWriteMethodName, 2, args);
             if (indexedWriteMethod != null) {
                 if (!indexedWriteMethod.getReturnType().equals(void.class)) {
@@ -289,7 +289,7 @@
         throws IntrospectionException {
 
         // If the indexed property type has not been set, then set it.
-        Class type = findIndexedPropertyType(getIndexedReadMethod(),
+        Class<?> type = findIndexedPropertyType(getIndexedReadMethod(),
                                              writeMethod);
         setIndexedPropertyType(type);
         setIndexedWriteMethod0(writeMethod);
@@ -319,7 +319,7 @@
      *         or {@code null} if the type cannot be determined
      */
     public synchronized Class<?> getIndexedPropertyType() {
-        Class type = getIndexedPropertyType0();
+        Class<?> type = getIndexedPropertyType0();
         if (type == null) {
             try {
                 type = findIndexedPropertyType(getIndexedReadMethod(),
@@ -334,11 +334,11 @@
 
     // Private methods which set get/set the Reference objects
 
-    private void setIndexedPropertyType(Class type) {
+    private void setIndexedPropertyType(Class<?> type) {
         this.indexedPropertyTypeRef = getWeakReference(type);
     }
 
-    private Class getIndexedPropertyType0() {
+    private Class<?> getIndexedPropertyType0() {
         return (this.indexedPropertyTypeRef != null)
                 ? this.indexedPropertyTypeRef.get()
                 : null;
@@ -356,10 +356,10 @@
                 : null;
     }
 
-    private Class findIndexedPropertyType(Method indexedReadMethod,
+    private Class<?> findIndexedPropertyType(Method indexedReadMethod,
                                           Method indexedWriteMethod)
         throws IntrospectionException {
-        Class indexedPropertyType = null;
+        Class<?> indexedPropertyType = null;
 
         if (indexedReadMethod != null) {
             Class params[] = getParameterTypes(getClass0(), indexedReadMethod);
@@ -389,7 +389,7 @@
             }
             indexedPropertyType = params[1];
         }
-        Class propertyType = getPropertyType();
+        Class<?> propertyType = getPropertyType();
         if (propertyType != null && (!propertyType.isArray() ||
                                      propertyType.getComponentType() != indexedPropertyType)) {
             throw new IntrospectionException("type mismatch between indexed and non-indexed methods: "