[ https://issues.apache.org/jira/browse/BEANUTILS-492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15329814#comment-15329814 ]
Stian Soiland-Reyes commented on BEANUTILS-492: ----------------------------------------------- The behaviour seems to ahve changed in Java 8: [Is JRE 1.8 still JavaBean specs compliant about IndexedPropertyDescriptor?|http://stackoverflow.com/questions/34726164/is-jre-1-8-still-javabean-specs-compliant-about-indexedpropertydescriptor] [Java JDK 8 IndexedPropertyDescriptor has changed since JDK 7 with List object|http://stackoverflow.com/questions/30663238/java-jdk-8-indexedpropertydescriptor-has-changed-since-jdk-7-with-list-object] Basically I think a List bean is no longer supported with an IndexedPropertyDescriptor - only for [] arrays. So should we change our javadoc on supposedly supporting List and remove those tests? Or is anyone able to write a generic BeanInfo we can use to get the indexed properties? > PropertyDescriptor ClassCastException with JDK8 > ----------------------------------------------- > > Key: BEANUTILS-492 > URL: https://issues.apache.org/jira/browse/BEANUTILS-492 > Project: Commons BeanUtils > Issue Type: Bug > Affects Versions: 1.9.3 > Environment: maven:3.3-jdk8 > Reporter: Stian Soiland-Reyes > Priority: Critical > Fix For: 1.9.3 > > > With MAven 3.3 and JDK 8, Common Beanutils fails: > https://builds.apache.org/view/Apache%20Commons/job/Commons%20Beanutils%20docker/4/console > {code} > Failed tests: > IndexedPropertyTestCase.testArrayListIndexedPropertyDescriptor:175 Not > IndexedPropertyDescriptor expected:<class > java.beans.IndexedPropertyDescriptor> but was:<class > java.beans.PropertyDescriptor> > IndexedPropertyTestCase.testArrayListReadMethod:316 Threw exception > java.lang.ClassCastException: java.beans.PropertyDescriptor cannot be cast to > java.beans.IndexedPropertyDescriptor > IndexedPropertyTestCase.testArrayListWriteMethod:330 Threw exception > java.lang.ClassCastException: java.beans.PropertyDescriptor cannot be cast to > java.beans.IndexedPropertyDescriptor > IndexedPropertyTestCase.testListIndexedPropertyDescriptor:156 Not > IndexedPropertyDescriptor expected:<class > java.beans.IndexedPropertyDescriptor> but was:<class > java.beans.PropertyDescriptor> > IndexedPropertyTestCase.testListIndexedReadMethod:288 Threw exception > java.lang.ClassCastException: java.beans.PropertyDescriptor cannot be cast to > java.beans.IndexedPropertyDescriptor > IndexedPropertyTestCase.testListIndexedWriteMethod:302 Threw exception > java.lang.ClassCastException: java.beans.PropertyDescriptor cannot be cast to > java.beans.IndexedPropertyDescriptor > IndexedPropertyTestCase.testListReadMethod:256 Threw exception > java.lang.ClassCastException: java.beans.PropertyDescriptor cannot be cast to > java.beans.IndexedPropertyDescriptor > IndexedPropertyTestCase.testListWriteMethod:274 Threw exception > java.lang.ClassCastException: java.beans.PropertyDescriptor cannot be cast to > java.beans.IndexedPropertyDescriptor > Jira422TestCase.testRootBean:36 expected:<java.[lang.String]> but > was:<java.[util.List]> > Jira422TestCase.testSecondChildBean:42 expected:<java.[lang.String]> but > was:<java.[util.List]> > {code} > It seems some assumptions about java.beans.PropertyDescriptor implementation > are no longer true in JDK 8. -- This message was sent by Atlassian JIRA (v6.3.4#6332)