You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Pierre Bourret (JIRA)" <ji...@apache.org> on 2011/01/13 13:22:45 UTC
[jira] Created: (FELIX-2779) iPOJO manipulator badly supports
custom annotation attributes of type Class
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
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.
[jira] Updated: (FELIX-2779) iPOJO manipulator badly supports
custom annotation attributes of type Class
Posted by "Pierre Bourret (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Updated: (FELIX-2779) iPOJO manipulator badly supports
custom annotation attributes of type Class
Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Clement Escoffier updated FELIX-2779:
-------------------------------------
Fix Version/s: iPOJO-1.8.0
Assignee: Clement Escoffier
> 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
> Assignee: Clement Escoffier
> Priority: Minor
> Fix For: iPOJO-1.8.0
>
> 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.
[jira] Resolved: (FELIX-2779) iPOJO manipulator badly supports
custom annotation attributes of type Class
Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Clement Escoffier resolved FELIX-2779.
--------------------------------------
Resolution: Fixed
I've applied the patch !
Thanks.
PS: the strange String is the Class internal name.
> 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
> Assignee: Clement Escoffier
> Priority: Minor
> Fix For: iPOJO-1.8.0
>
> 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.
[jira] Closed: (FELIX-2779) iPOJO manipulator badly supports custom
annotation attributes of type Class
Posted by "Pierre Bourret (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pierre Bourret closed FELIX-2779.
---------------------------------
OK : tested with iPOJO-1.8.0
> 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
> Assignee: Clement Escoffier
> Priority: Minor
> Fix For: iPOJO-1.8.0
>
> 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.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira