proxy annotation issue

View: New views
4 Messages — Rating Filter:   Alert me  

proxy annotation issue

by Oleg Gorobets :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hello all!

 

I’ve encountered a tricky bug in cglib. When creating proxy with callback that implements MethodInterceptor the resulted proxy loses all annotations on methods. I’ve created a TestNG test-case to illustrate this (see attached file). proxyWithMethodCallBack() test will fail when trying to get annotation from proxy.

 

Does anyone have suggestions on how to fix this?



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
cglib-devel mailing list
cglib-devel@...
https://lists.sourceforge.net/lists/listinfo/cglib-devel

EnhancerTests.java (2K) Download Attachment

Re: proxy annotation issue

by Mike McCown :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Did you ever get an answer to this?  We're trying to work around the same issue...

Thanks

Mike

Oleg Gorobets wrote:
Hello all!

 

I've encountered a tricky bug in cglib. When creating proxy with callback
that implements MethodInterceptor the resulted proxy loses all annotations
on methods. I've created a TestNG test-case to illustrate this (see attached
file). proxyWithMethodCallBack() test will fail when trying to get
annotation from proxy.

 

Does anyone have suggestions on how to fix this?


 
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
cglib-devel mailing list
cglib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cglib-devel

Re: proxy annotation issue

by Oleg Gorobets :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Still no answer till now, developers keep silence about it. Seems like there is no other way to contact them but this list. The issue is hidden deep inside the code generation logic, so it's better to get even a hint from them before investigating. Anyway, if you manage to find the answer on this please let me know.

Oleg
Did you ever get an answer to this?  We're trying to work around the same
issue...

Thanks

Mike


Oleg Gorobets wrote:
  
Hello all!

 

I've encountered a tricky bug in cglib. When creating proxy with callback
that implements MethodInterceptor the resulted proxy loses all annotations
on methods. I've created a TestNG test-case to illustrate this (see
attached
file). proxyWithMethodCallBack() test will fail when trying to get
annotation from proxy.

 

Does anyone have suggestions on how to fix this? 




    

  


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
cglib-devel mailing list
cglib-devel@...
https://lists.sourceforge.net/lists/listinfo/cglib-devel

Re: proxy annotation issue

by Henri Tremblay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm not a cglib developer but I worked a lot with it. From as far as I
know, this behavior is "normal". cglib will create a proxy that
extends your class. The annotations are still on the base class but
not on the proxy. That's the same behavior as for any class extending
a class with annotations. If you want to know if a method was
annotated in one of its overrides, you need to loop in the complete
hierarchy.

That said, I can see why this feature could be useful. It makes it
easier to replace the class by its proxy. So some flag
"inheritAnnotations" could be useful. That would means a new java 5
only version of cglib thought.

Hope it helps,
Henri

On Fri, Aug 8, 2008 at 12:06 AM, Oleg Gorobets <oleg.goro@...> wrote:

> Still no answer till now, developers keep silence about it. Seems like there
> is no other way to contact them but this list. The issue is hidden deep
> inside the code generation logic, so it's better to get even a hint from
> them before investigating. Anyway, if you manage to find the answer on this
> please let me know.
>
> Oleg
>
> Did you ever get an answer to this?  We're trying to work around the same
> issue...
>
> Thanks
>
> Mike
>
>
> Oleg Gorobets wrote:
>
>
> Hello all!
>
>
>
> I've encountered a tricky bug in cglib. When creating proxy with callback
> that implements MethodInterceptor the resulted proxy loses all annotations
> on methods. I've created a TestNG test-case to illustrate this (see
> attached
> file). proxyWithMethodCallBack() test will fail when trying to get
> annotation from proxy.
>
>
>
> Does anyone have suggestions on how to fix this?
>
>
>
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> cglib-devel mailing list
> cglib-devel@...
> https://lists.sourceforge.net/lists/listinfo/cglib-devel
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
cglib-devel mailing list
cglib-devel@...
https://lists.sourceforge.net/lists/listinfo/cglib-devel