You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Miguel Costa (Jira)" <ji...@apache.org> on 2023/02/13 22:43:00 UTC

[jira] [Commented] (DBUTILS-150) BeanProcessor populateBean does not work when PropertyDescriptor is of type

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

Miguel Costa commented on DBUTILS-150:
--------------------------------------

the list comes from 
return beanInfo.getPropertyDescriptors();
 
and from the API I get so I think it's safe to assume that indeed the descriptors might also be IndexedPropertyDescriptor :
{code:java}
/**
* Returns descriptors for all properties of the bean.
* <p>
* If a property is indexed, then its entry in the result array
* belongs to the {@link IndexedPropertyDescriptor} subclass
* of the {@link PropertyDescriptor} class.
* A client of the {@code getPropertyDescriptors} method
* can use the {@code instanceof} operator to check
* whether a given {@code PropertyDescriptor}
* is an {@code IndexedPropertyDescriptor}.
*
* @return an array of {@code PropertyDescriptor} objects,
* or {@code null} if the information is to
* be obtained through the automatic analysis
*/
PropertyDescriptor[] getPropertyDescriptors();{code}

> BeanProcessor populateBean does not work when PropertyDescriptor is of type 
> ----------------------------------------------------------------------------
>
>                 Key: DBUTILS-150
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-150
>             Project: Commons DbUtils
>          Issue Type: Improvement
>    Affects Versions: 1.7
>            Reporter: Miguel Costa
>            Priority: Major
>             Fix For: 1.8
>
>
> I've been using DB utils for a while to help me handle some custom beans (Protobufs)
> Anyway while debugging an issue I'm facing I noticed that the function 
> BeanProcessor.populateBean is not able to handle 
> PropertyDescriptor when their class is IndexedPropertyDescriptor instead of a normal PropertyDescriptor.
> IndexedPropertyDescriptor  extends PropertyDescriptor so I would expect this to work without any issue, but currently it does not
>  
> I can provide a PR for review with my best approach for it



--
This message was sent by Atlassian Jira
(v8.20.10#820010)