Kabir,
I just downloaded AOP 1.5.3 and I'm still seeing the same behavior on
my test case...here is the verbose output when running the testcase
| [debug] Passed in instrumentor: null
| [debug] Defaulting instrumentor to:
org.jboss.aop.instrument.ClassicInstrumentor
| [debug] jboss.aop.class.path: /workspace/aop-problem/src/java
| [debug] Looking for aspects in: testcase.ZImpl
| [debug] Looking for aspects in: testcase.B
| [debug] Looking for aspects in: testcase.MyFieldAnnotation
| [debug] Looking for aspects in: testcase.A
| [debug] Looking for aspects in: testcase.Main
| [debug] Looking for aspects in: testcase.MyFieldInterceptor
| [debug] Found @InterceptorDef in: testcase.MyFieldInterceptor
| [debug] Looking for aspects in: testcase.C
| [debug] Looking for aspects in: testcase.Z
| [debug] jboss.aop.search.classpath: 'null' true
| [debug] jboss.aop.path: null
| [trying to transform] testcase.Main
| [debug] There are no caller pointcuts!
| [debug] [EMAIL PROTECTED] static main ([Ljava/lang/String;)V] matches no
pointcuts
| [debug] [EMAIL PROTECTED] Main ()V] matches no pointcuts
| [debug] [EMAIL PROTECTED] C ()V] matches no pointcuts
| [debug] [EMAIL PROTECTED] B ()V] matches no pointcuts
| [debug] testcase.A.myField:Ljava/lang/String; matches pointcut: get(*
*->@testcase.MyFieldAnnotation)
| [debug] testcase.A.myField:Ljava/lang/String; matches no pointcuts
| [debug] [EMAIL PROTECTED] A ()V] matches no pointcuts
| [debug] was testcase.Main converted: true
| [trying to transform] testcase.C
| [debug] There are no caller pointcuts!
| [debug] [EMAIL PROTECTED] toString ()Ljava/lang/String;] matches no
pointcuts
| [debug] [EMAIL PROTECTED] C ()V] matches no pointcuts
| [debug] was testcase.C converted: false
| [trying to transform] testcase.B
| [debug] There are no caller pointcuts!
| [debug] [EMAIL PROTECTED] B ()V] matches no pointcuts
| [debug] testcase.A.myField:Ljava/lang/String; matches pointcut: get(*
*->@testcase.MyFieldAnnotation)
| [debug] testcase.A.myField:Ljava/lang/String; matches no pointcuts
| [debug] was testcase.B converted: true
| [trying to transform] testcase.A
| [debug] There are no caller pointcuts!
| [debug] [EMAIL PROTECTED] A ()V] matches no pointcuts
| [debug] testcase.A.myField:Ljava/lang/String; matches pointcut: get(*
*->@testcase.MyFieldAnnotation)
| [debug] testcase.A.myField:Ljava/lang/String; matches no pointcuts
| [debug] was testcase.A converted: true
| iterate binding testcase.MyFieldInterceptor
| field matched binding testcase.MyFieldInterceptor
| [debug] added advisor: testcase.A from binding: testcase.MyFieldInterceptor
| Using context classloader [EMAIL PROTECTED] to load aspect
testcase.MyFieldInterceptor
| [trying to transform] testcase.MyFieldInterceptor
| [debug] There are no caller pointcuts!
| [debug] [EMAIL PROTECTED] getName ()Ljava/lang/String;] matches no pointcuts
| [debug] [EMAIL PROTECTED] invoke
(Lorg/jboss/aop/joinpoint/Invocation;)Ljava/lang/Object;] matches no pointcuts
| [debug] [EMAIL PROTECTED] MyFieldInterceptor ()V] matches no pointcuts
| [debug] was testcase.MyFieldInterceptor converted: false
| null
|
were you able to get the test case i sent you to run correctly (with the
duplicated myField inherited variable in class B commented out)?
Upon further investigation it seems that the interceptor is invoked on the
inherited field as long as the field is not called from within the subclass
itself...what I mean is that in subclass C I have a toString method that
returns the inherited A.myField value....
| public class C extends B<ZImpl>
| {
| public String toString()
| {
| return myField;
| }
| }
|
If the inherited field is not duplicated in class B and I call C.toString the
interceptor is not run on the inherited A.myField...however...if within the
main class i directly call C.myField like this..
|
| public class Main
| {
| /**
| * @author gdunkle
| * @param args
| * TODO Implement auto-generated method stub
| */
| public static void main(String[] args)
| {
| C cInstance=new C();
| System.out.println(cInstance.toString());
| System.out.println(cInstance.myField);
| }
| }
|
the interceptor is run. I just reran the test case with the 1.5.2 release and
the second print line in Main did not invoke the interceptor so it looks like
that part of the issue was indeed solved by 1.5.3.
So I guess my new issue is that the interceptors are not being called on fields
inherited through the superclass from inside the subclass itself. Should this
be expected behavior? Could you please comment?
Thanks
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4003309#4003309
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4003309
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user