commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Crown (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEANUTILS-422) getPropertyType return null on second descendant class
Date Mon, 04 Mar 2013 07:01:17 GMT

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

Alex Crown commented on BEANUTILS-422:
--------------------------------------

It fails only when property type has generic qualifier. You need replace ArrayList with ArrayList<String>
in Jira422TestCase.

On the other hand, this is workaround for my project. I did not think to try to remove generic
qualifier.
                
> 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: Benedikt Ritter
>             Fix For: 1.8.4
>
>         Attachments: PropertyUtilsBean.java.patch, Test.java
>
>
> 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