Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in annotation value access #137

Closed
petitpre opened this issue Jan 16, 2015 · 1 comment
Closed

Bug in annotation value access #137

petitpre opened this issue Jan 16, 2015 · 1 comment

Comments

@petitpre
Copy link
Contributor

There are 2 ways to annotate an element with an array parameter:
@AnnotArray({ RuntimeException.class })
public void testValueWithArray() ;
@AnnotArray(RuntimeException.class)
public void testValueWithoutArray() ;

When I try to access to the annotation parameter with spoon with something like:
myCtMethod.getAnnotation(AnnotArray.class).value()

It work only with the first method example. The second fail with exception:
java.lang.ClassCastException: java.lang.Class cannot be cast to [Ljava.lang.Class;
at com.sun.proxy.$Proxy3.value(Unknown Source)

I've write a test that surround this bug:
https://github.com/petitpre/spoon/blob/bugValues/src/test/java/spoon/test/annotation/AnnotationTest.java#L345

@swolf91
Copy link
Contributor

swolf91 commented Jan 22, 2015

Seems to be a duplication of #132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants