You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Ni...@fr.thalesgroup.com on 2010/08/16 11:58:53 UTC

RE: IPojo manipulation & annotation on parameters

Hi Clement,
Thank you for your reply. I have open a new issue for this bug at
https://issues.apache.org/jira/browse/FELIX-2542 
Best regards,
Nicolas Dumont

-----Message d'origine-----
De : Clement Escoffier [mailto:clement.escoffier@gmail.com] 
Envoyé : vendredi 30 juillet 2010 20:22
À : users@felix.apache.org
Objet : Re: IPojo manipulation & annotation on parameters


On 30.07.2010, at 11:01, Nicolas Dumont wrote:

> Hi,
> I am trying to read by reflection annotations at runtime, and I found a
> strange behaviour.
> 
> I defined some new annotations targeting methods
> (@Target(ElementType.METHOD)) or parameters
@Target(ElementType.PARAMETER),
> with RetentionPolicy set to RUNTIME.
> 
> When I look at an ipojo class containing those kind of annotations, I find
> the annotations on method, but not on its parameters. I find the
parameters
> annotations on the parameters of the __method.
> 
> Regarding the explanation on
> http://felix.apache.org/site/dive-into-the-ipojo-manipulation-depths.html
/
> "The annotation special case":
> 
> 
> "The manipulation has a special behavior when a visible (at runtime)
method
> or constructor annotation is detected. As the methods are replaced by
> private methods, the annotations are moved to the iPOJO replacements such
as
> in:
> public class MyClass {
>  @MyAnnotation
>  public void myMethod() {
>     //my code here
> }
> }
> is transformed into:
> public class MyClass {
>  @MyAnnotation
>  public void myMethod() {
>     // iPojo code here
> }
>  private void _myMethod() {
>   // my code here
> }
> "
> 
> 
> 
> In my case I have a annotation on a parameter of myMethod and the observed
> result is:
> 
> public class MyClass {
>  @MyAnnotation
>  public void myMethod(@MyParameterAnnotation int param) {
>     //my code here
> }
> }
> is transformed into:
> public class MyClass {
>  @MyAnnotation
>  public void myMethod(int param) {
>     // iPojo code here
> }
>  private void _myMethod(@MyParameterAnnotation int param) {
>   // my code here
> }
> 
> Naively I would have think that parameters annotation would have been
moved
> to the ipojo replacement class, as for methods annotations. Is this a bug
or
> standard behaviour ?


It sounds like a bug :-)
The annotations on parameter are not moved. It should be done. Please open a
bug about that on 'https://issues.apache.org/jira/secure/BrowseProject.jspa'
(component : iPOJO).

Thanks,

Clement

> 
> Thanks in advance.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org