jdk/src/share/classes/java/beans/Introspector.java
changeset 3241 6fd229e009e7
parent 3239 f675984c2349
child 3476 b27b095ea77b
equal deleted inserted replaced
3240:2f79c1748c93 3241:6fd229e009e7
   522                         } else if (resultType == boolean.class && name.startsWith(IS_PREFIX)) {
   522                         } else if (resultType == boolean.class && name.startsWith(IS_PREFIX)) {
   523                             // Boolean getter
   523                             // Boolean getter
   524                             pd = new PropertyDescriptor(this.beanClass, name.substring(2), method, null);
   524                             pd = new PropertyDescriptor(this.beanClass, name.substring(2), method, null);
   525                         }
   525                         }
   526                     } else if (argCount == 1) {
   526                     } else if (argCount == 1) {
   527                         if (argTypes[0] == int.class && name.startsWith(GET_PREFIX)) {
   527                         if (int.class.equals(argTypes[0]) && name.startsWith(GET_PREFIX)) {
   528                             pd = new IndexedPropertyDescriptor(this.beanClass, name.substring(3), null, null, method, null);
   528                             pd = new IndexedPropertyDescriptor(this.beanClass, name.substring(3), null, null, method, null);
   529                         } else if (resultType == void.class && name.startsWith(SET_PREFIX)) {
   529                         } else if (void.class.equals(resultType) && name.startsWith(SET_PREFIX)) {
   530                             // Simple setter
   530                             // Simple setter
   531                             pd = new PropertyDescriptor(this.beanClass, name.substring(3), null, method);
   531                             pd = new PropertyDescriptor(this.beanClass, name.substring(3), null, method);
   532                             if (throwsException(method, PropertyVetoException.class)) {
   532                             if (throwsException(method, PropertyVetoException.class)) {
   533                                 pd.setConstrained(true);
   533                                 pd.setConstrained(true);
   534                             }
   534                             }
   535                         }
   535                         }
   536                     } else if (argCount == 2) {
   536                     } else if (argCount == 2) {
   537                             if (argTypes[0] == int.class && name.startsWith(SET_PREFIX)) {
   537                             if (void.class.equals(resultType) && int.class.equals(argTypes[0]) && name.startsWith(SET_PREFIX)) {
   538                             pd = new IndexedPropertyDescriptor(this.beanClass, name.substring(3), null, null, null, method);
   538                             pd = new IndexedPropertyDescriptor(this.beanClass, name.substring(3), null, null, null, method);
   539                             if (throwsException(method, PropertyVetoException.class)) {
   539                             if (throwsException(method, PropertyVetoException.class)) {
   540                                 pd.setConstrained(true);
   540                                 pd.setConstrained(true);
   541                             }
   541                             }
   542                         }
   542                         }