[jboss-jira] [JBoss JIRA] Commented: (JASSIST-73) getAvailableAnnotations() sometimes returns null for the same method in unittesting
Shigeru Chiba (JIRA)
jira-events at lists.jboss.org
Mon Feb 2 11:33:44 EST 2009
[ https://jira.jboss.org/jira/browse/JASSIST-73?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12450672#action_12450672 ]
Shigeru Chiba commented on JASSIST-73:
--------------------------------------
Have you tried method.getAnnotations()? It would raise an exception if one of the annotation types is not found. getAvailableAnnotations() simple ignores an unknown annotation and returns null.
> getAvailableAnnotations() sometimes returns null for the same method in unittesting
> -----------------------------------------------------------------------------------
>
> Key: JASSIST-73
> URL: https://jira.jboss.org/jira/browse/JASSIST-73
> Project: Javassist
> Issue Type: Bug
> Environment: Eclipse Ganymede, Windows Vista, jUnit 3.4...
> Reporter: Christian Ã
kerström
> Assignee: Shigeru Chiba
>
> We have developed a jUnit testcase that test the annotation for an existing method.
> Our own classloader first loads the class that contains the method and then tries to get any available annotations.
> Our annotated method looks like this, using our own NotificationEmitter.class.
> @NotificationEmitter(description = "Notifies xxx", type = xxx.class)
> public void method() {
> ...
> }
> Sometimes when we call method.getAvailableAnnotations(); it returns
> When it fails seems to be very nondeterministic.
> Any help would be appreciated.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list