commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEANUTILS-422) getPropertyType return null on second descendant class
Date Mon, 18 Feb 2013 20:43:13 GMT

    [ https://issues.apache.org/jira/browse/BEANUTILS-422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13580823#comment-13580823
] 

Oliver Heger commented on BEANUTILS-422:
----------------------------------------

This is interesting. I also encountered some strange behavior related to introspection and
BeanUtils on Java 7: The current build of Commons Configuration (which uses BeanUtils) fails
with an error that no write method for a property can be found. I have not had a closer look
yet, but I do not think that the affected property is an indexed property. In any case, the
behavior of bean introspection seems to have changed in Java 7.
                
> getPropertyType return null on second descendant class
> ------------------------------------------------------
>
>                 Key: BEANUTILS-422
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-422
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.3
>         Environment: Oracle JDK 1.7.0.10 and later.
>            Reporter: Alex Crown
>            Assignee: Oliver Heger
>         Attachments: test.zip
>
>
> PropertyUtils.getPropertyType() for IndexedProperty works only for first invoked descendant
class. 
> Bug reproduced in JDK 1.7.0.10 - 13. In JDK 1.7.0.9 it works fine. As I see, in JDK 1.7.0.10
java.beans.Introspector was changed, but I don't understand how it works.
> *Example*
> *file* is IndexedProperty of the RootBean (attachend to issue) with type ArrayList<String>.
> RoootBean has two empty descendans: *FirstChildBean* and *SecondChildBean*.
> {code}
> RootBean bean = new FirstChildBean();
> Class propertyType = PropertyUtils.getPropertyType(bean, "file[0]");
> System.out.println(propertyType != null ? propertyType.getName() : null);
> -- Expected: java.lang.String, Actual: java.lang.String
> bean = new SecondChildBean();
> propertyType = PropertyUtils.getPropertyType(bean, "file[0]");
> System.out.println(propertyType != null ? propertyType.getName() : null);
> -- Expected: java.lang.String, Actual: null
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message