beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Song (JIRA)" <>
Subject [jira] Closed: (BEEHIVE-149) Bean introspection fails for annotation-valued properties
Date Mon, 20 Jun 2005 19:53:17 GMT
     [ ]
James Song closed BEEHIVE-149:

A test is added by r191545 and passes.

> Bean introspection fails for annotation-valued properties
> ---------------------------------------------------------
>          Key: BEEHIVE-149
>          URL:
>      Project: Beehive
>         Type: Bug
>   Components: Controls
>     Versions: V1Alpha
>     Reporter: Kyle Marvin
>     Assignee: James Song
>     Priority: Minor
>      Fix For: V1Beta

> BeanInfo introspection of a Control type that has a property that is based upon a JSR-175
annotation type will fail w/ an Introspection exception.   The following is a sample exception,
based upon the org.apache.beehive.controls.test.controls.basic.Hello test control included
in the checkin tests:
> Caused by: java.beans.IntrospectionException: Method not found: setGender
>         at java.beans.PropertyDescriptor.<init>(
>         at java.beans.PropertyDescriptor.<init>(
>         at org.apache.beehive.controls.test.controls.basic.HelloBeanBeanInfo.initPropertyDescriptors(
>         at org.apache.beehive.controls.test.controls.basic.HelloBeanBeanInfo.getPropertyDescriptors(
>         at java.beans.Introspector.getTargetPropertyInfo(
>         at java.beans.Introspector.getBeanInfo(
>         at java.beans.Introspector.getBeanInfo(
> The rub is that the java.beans.PropertyDescriptor class expects to find a method with
the following signature:
>         public void setGender(Gender gender);
> while bean exposes the following instead:
>         public void setGender(PropertyMap genderMap);
> This is because it is impossible to 'new' a JSR-175 annotation type and initialize its
values, so the PropertyMap interface (and the corresponsing concrete impl, BeanPropertyMap)
exists to abstract a collection of annotation type property values.  You can create a BeanPropertyMap,
push values into it, and then use it to set the (annotation-typed) property.
> The fix is to modify the BeanInfo codegen to use the java.beans.PropertyDescriptor constructor
that takes actual java.lang.reflect.Methods as arguments, to explicitly specify the specific
setter method on the bean class instead of allowing PropertyDescriptor to use the default

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message