Skip to content

Conversation

@WonderCsabo
Copy link

No description provided.

We are copying all annotations to overriden classes, methods, method
arguments etc, what are not from our package. This commit adds the
ability to AA to copy the annotation parameters, too.
Note that annotation as an annotation parameter is not supported yet.
yDelouis added a commit that referenced this pull request May 2, 2014
Adding parameters to copied annotations
@yDelouis yDelouis merged commit 41e1ae0 into yDelouis:782_otherAnnotations May 2, 2014
@yDelouis
Copy link
Owner

yDelouis commented May 2, 2014

👍 Great job ! Thanks

@WonderCsabo
Copy link
Author

I forgot to add license headers. Please merge the last commit from WonderCsabo:782_otherAnnotations.

@yDelouis
Copy link
Owner

yDelouis commented May 2, 2014

Done.

@WonderCsabo
Copy link
Author

Do you have any idea about annotation parameters?

@yDelouis
Copy link
Owner

yDelouis commented May 2, 2014

I tried using Class.forName, but it doesn't work if the annotation is defined in the same project because the .class file doesn't exist yet during annotations processing. (It seems to work if the annotation come from a dependency).

I succeed to make it work with annotation parameters using reflection to access the private constructor of JAnnotationUse(JClass clazz) and the private method addValue(String name, JAnnotationValue value). But it smells very bad.

@WonderCsabo
Copy link
Author

Smells bad or not,unfortunately i see no way other than Reflection.

@yDelouis
Copy link
Owner

yDelouis commented May 2, 2014

I have pushed my changes on my PR to the excilys repo.

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

Successfully merging this pull request may close these issues.

2 participants