jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java

Print this page

        

*** 371,386 **** throw new IntrospectionException("bad indexed write method arg count"); } if (params[0] != Integer.TYPE) { throw new IntrospectionException("non int index to indexed write method"); } ! if (indexedPropertyType != null && indexedPropertyType != params[1]) { throw new IntrospectionException( "type mismatch between indexed read and indexed write methods: " + getName()); } - indexedPropertyType = params[1]; } Class<?> propertyType = getPropertyType(); if (propertyType != null && (!propertyType.isArray() || propertyType.getComponentType() != indexedPropertyType)) { throw new IntrospectionException("type mismatch between indexed and non-indexed methods: " --- 371,387 ---- throw new IntrospectionException("bad indexed write method arg count"); } if (params[0] != Integer.TYPE) { throw new IntrospectionException("non int index to indexed write method"); } ! if (indexedPropertyType == null || params[1].isAssignableFrom(indexedPropertyType)) { ! indexedPropertyType = params[1]; ! } else if (!indexedPropertyType.isAssignableFrom(params[1])) { throw new IntrospectionException( "type mismatch between indexed read and indexed write methods: " + getName()); } } Class<?> propertyType = getPropertyType(); if (propertyType != null && (!propertyType.isArray() || propertyType.getComponentType() != indexedPropertyType)) { throw new IntrospectionException("type mismatch between indexed and non-indexed methods: "