vipx / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Class annotation lost then after Injection #744

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Description of the issue:

Steps to reproduce:
1. Create a instance class fool with a custom annotation: @MyTest.
2. Guice.createInjector(new InterceptorModule()).injectMemeber(this);
3. When try to get the annotation from fool, no annotation found; 

Original issue reported on code.google.com by dave.che...@gmail.com on 7 Apr 2013 at 6:13

GoogleCodeExporter commented 9 years ago
Note this is expected behaviour when using AOP - to intercept the methods Guice 
needs to create a subclass of the original class, so unless your annotation has 
@java.lang.annotation.Inherited (and is a class annotation) then you will need 
to check the superclass for the original annotations.

Original comment by mccu...@gmail.com on 7 Apr 2013 at 6:19

GoogleCodeExporter commented 9 years ago

Original comment by sberlin on 7 Apr 2013 at 6:31

GoogleCodeExporter commented 9 years ago
Does Guice provide something like Spring AopUtils.isAopProxy(Object object)?
So  I can check if a class is a enhanced by Guice? 

Original comment by dave.che...@gmail.com on 9 Apr 2013 at 4:45