felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pierre Bourret (JIRA)" <j...@apache.org>
Subject [jira] Updated: (FELIX-2779) iPOJO manipulator badly supports custom annotation attributes of type Class
Date Thu, 13 Jan 2011 15:47:46 GMT

     [ https://issues.apache.org/jira/browse/FELIX-2779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Pierre Bourret updated FELIX-2779:
----------------------------------

    Attachment: FixBadClassParameterHandlingInCustomAnnotationVisitor.patch

The problem is that the visit(String, Object) method of the CustomAnnotationVisitor is called
with a org.objectweb.asm.Type parameter when the annotation attribute type is a Class. The
Type.toString() method returns the internal type name, so getClassName() must be used instead.

Here is a patch that solves the problem in my case. It also handles the case of Class[] annotation
attribute type.

> iPOJO manipulator badly supports custom annotation attributes of type Class
> ---------------------------------------------------------------------------
>
>                 Key: FELIX-2779
>                 URL: https://issues.apache.org/jira/browse/FELIX-2779
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.6.0
>            Reporter: Pierre Bourret
>            Priority: Minor
>         Attachments: FixBadClassParameterHandlingInCustomAnnotationVisitor.patch
>
>
> I've written a custom handler and its corresponding annotation :
>    public @interface Portlet {
>       ...
>       Class<? extends PortletPresentation> portletClass();
>       ...
>    }
> Then I've defined a component using this annotation :
>    @Component
>    @Portlet(..., portletClass=DummyComponentPortletImpl.class)
>    public class DummyComponentImpl {
>       ...
>    }
> The problem is that the metadata computed by the manipulator doesn't hold the right value
for the portletClass attribute :
> I got "Lfr/liglab/adele/icasa/portal/impl/test/DummyComponentPortletImpl;" instead of
"fr.liglab.adele.icasa.portal.impl.test.DummyComponentPortletImpl".
> Despite it is still possible to deduce the original class name from this strange string,
isn't the attribute value supposed to contain the real class name instead of a Java internal
type name ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message