jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java
changeset 5947 0e6f2837eeca
parent 5506 202f599c92aa
child 6657 15dbb366c6a3
equal deleted inserted replaced
5769:2a390122edff 5947:0e6f2837eeca
   187                     indexedReadMethodName = Introspector.IS_PREFIX + getBaseName();
   187                     indexedReadMethodName = Introspector.IS_PREFIX + getBaseName();
   188                 } else {
   188                 } else {
   189                     indexedReadMethodName = Introspector.GET_PREFIX + getBaseName();
   189                     indexedReadMethodName = Introspector.GET_PREFIX + getBaseName();
   190                 }
   190                 }
   191             }
   191             }
   192 
   192             indexedReadMethod = Introspector.findInstanceMethod(cls, indexedReadMethodName, int.class);
   193             Class[] args = { int.class };
       
   194 
       
   195             indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName,
       
   196                                                         1, args);
       
   197             if (indexedReadMethod == null) {
   193             if (indexedReadMethod == null) {
   198                 // no "is" method, so look for a "get" method.
   194                 // no "is" method, so look for a "get" method.
   199                 indexedReadMethodName = Introspector.GET_PREFIX + getBaseName();
   195                 indexedReadMethodName = Introspector.GET_PREFIX + getBaseName();
   200                 indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName,
   196                 indexedReadMethod = Introspector.findInstanceMethod(cls, indexedReadMethodName, int.class);
   201                                                             1, args);
       
   202             }
   197             }
   203             setIndexedReadMethod0(indexedReadMethod);
   198             setIndexedReadMethod0(indexedReadMethod);
   204         }
   199         }
   205         return indexedReadMethod;
   200         return indexedReadMethod;
   206     }
   201     }
   268             }
   263             }
   269 
   264 
   270             if (indexedWriteMethodName == null) {
   265             if (indexedWriteMethodName == null) {
   271                 indexedWriteMethodName = Introspector.SET_PREFIX + getBaseName();
   266                 indexedWriteMethodName = Introspector.SET_PREFIX + getBaseName();
   272             }
   267             }
   273             indexedWriteMethod = Introspector.findMethod(cls, indexedWriteMethodName,
   268             indexedWriteMethod = Introspector.findInstanceMethod(cls, indexedWriteMethodName, int.class, type);
   274                          2, (type == null) ? null : new Class[] { int.class, type });
       
   275             if (indexedWriteMethod != null) {
   269             if (indexedWriteMethod != null) {
   276                 if (!indexedWriteMethod.getReturnType().equals(void.class)) {
   270                 if (!indexedWriteMethod.getReturnType().equals(void.class)) {
   277                     indexedWriteMethod = null;
   271                     indexedWriteMethod = null;
   278                 }
   272                 }
   279             }
   273             }