[jboss-jira] [JBoss JIRA] Commented: (JASSIST-111) AnnotationMemberValue fails if a member is an array

Kabir Khan (JIRA) jira-events at lists.jboss.org
Mon Mar 29 08:27:37 EDT 2010


    [ https://jira.jboss.org/jira/browse/JASSIST-111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12522559#action_12522559 ] 

Kabir Khan commented on JASSIST-111:
------------------------------------

Need to be able to parse things like
public class AnnotatedClass
{
   @TestAnnotation(clazz=String.class)
   int withPlainClass;
   
   @TestAnnotation(clazz=String[].class)
   int withClassArray;
   
   @TestAnnotation(clazz=String[][].class)
   int with2DClassArray;
   
   @TestAnnotation(clazz=int[][][].class)
   int with3DIntArray;
}

They fail with errors like:

java.lang.reflect.UndeclaredThrowableException
	at $Proxy0.clazz(Unknown Source)
	at test.javassist.annotation.AnnotationArrayTestCase.checkAnnotation(AnnotationArrayTestCase.java:51)
	at test.javassist.annotation.AnnotationArrayTestCase.test1DStringArrayValue(AnnotationArrayTestCase.java:23)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: java/lang/String[]
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:247)
	at javassist.bytecode.annotation.MemberValue.loadClass(MemberValue.java:55)
	at javassist.bytecode.annotation.ClassMemberValue.getValue(ClassMemberValue.java:85)
	at javassist.bytecode.annotation.AnnotationImpl.invoke(AnnotationImpl.java:148)
	... 21 more



> AnnotationMemberValue fails if a member is an array
> ---------------------------------------------------
>
>                 Key: JASSIST-111
>                 URL: https://jira.jboss.org/jira/browse/JASSIST-111
>             Project: Javassist
>          Issue Type: Bug
>    Affects Versions: 3.11.0.GA
>            Reporter: Kabir Khan
>            Assignee: Kabir Khan
>             Fix For: 3.12.0.GA
>
>


-- 
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