Re: [aspectj-users] Behaviours of new constructor added by AspectJ ITD
Hi Andy: Thanks a lot for your elaboration :) -- View this message in context: http://aspectj.2085585.n4.nabble.com/Behaviours-of-new-constructor-added-by-AspectJ-ITD-tp4651015p4651045.html Sent from the AspectJ - users mailing list archive at Nabble.com. ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users
Re: [aspectj-users] Behaviours of new constructor added by AspectJ ITD
Some background on Q1: public class Child { public String name = John; public Child(String desc) { } public Child(int bar) { } } When this code is compiled the bytecode to set name to 'John' is included in every constructor within the class (without anything to mark that bytecode as existing due to field initialization). It isn't put into some other static 'initializer' method that can be invoked separately: public Child(java.lang.String); Code: stack=2, locals=2, args_size=2 0: aload_0 1: invokespecial #1 // Method java/lang/Object.init:()V 4: aload_0 5: ldc #2 // String John 7: putfield #3 // Field name:Ljava/lang/String; 10: return public Child(int); Code: stack=2, locals=2, args_size=2 0: aload_0 1: invokespecial #1 // Method java/lang/Object.init:()V 4: aload_0 5: ldc #2 // String John 7: putfield #3 // Field name:Ljava/lang/String; 10: return When we separately compile the aspect, we have no idea which bytecode we might need to copy from existing constructors to initialize fields. In your case you are compiling the source for the target and the source for the aspect together so in compiling the aspect we could look at the target source, but a guiding principal of AspectJ is that separate compilation works the same as 'altogether' compilation so whether the aspect is compiled with the target sources or against the bytecode for that target, it must do the same thing. This means if information cannot be determined from the bytecode, we just don't know it. Andy On 17 July 2013 06:12, pai pika...@gmail.com wrote: Hi thanks! so it seems for Q1, it's apsecJ's limitation. Thank you for the information :) I'll post Q2 question in another thread. Regards! -- View this message in context: http://aspectj.2085585.n4.nabble.com/Behaviours-of-new-constructor-added-by-AspectJ-ITD-tp4651015p4651028.html Sent from the AspectJ - users mailing list archive at Nabble.com. ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users
Re: [aspectj-users] Behaviours of new constructor added by AspectJ ITD
Thanks Andy, best explanation ever of Java field initialization as it relates to AspectJ. On 23/07/2013 8:15 AM, Andy Clement andrew.clem...@gmail.com wrote: Some background on Q1: public class Child { public String name = John; public Child(String desc) { } public Child(int bar) { } } When this code is compiled the bytecode to set name to 'John' is included in every constructor within the class (without anything to mark that bytecode as existing due to field initialization). It isn't put into some other static 'initializer' method that can be invoked separately: public Child(java.lang.String); Code: stack=2, locals=2, args_size=2 0: aload_0 1: invokespecial #1 // Method java/lang/Object.init:()V 4: aload_0 5: ldc #2 // String John 7: putfield #3 // Field name:Ljava/lang/String; 10: return public Child(int); Code: stack=2, locals=2, args_size=2 0: aload_0 1: invokespecial #1 // Method java/lang/Object.init:()V 4: aload_0 5: ldc #2 // String John 7: putfield #3 // Field name:Ljava/lang/String; 10: return When we separately compile the aspect, we have no idea which bytecode we might need to copy from existing constructors to initialize fields. In your case you are compiling the source for the target and the source for the aspect together so in compiling the aspect we could look at the target source, but a guiding principal of AspectJ is that separate compilation works the same as 'altogether' compilation so whether the aspect is compiled with the target sources or against the bytecode for that target, it must do the same thing. This means if information cannot be determined from the bytecode, we just don't know it. Andy On 17 July 2013 06:12, pai pika...@gmail.com wrote: Hi thanks! so it seems for Q1, it's apsecJ's limitation. Thank you for the information :) I'll post Q2 question in another thread. Regards! -- View this message in context: http://aspectj.2085585.n4.nabble.com/Behaviours-of-new-constructor-added-by-AspectJ-ITD-tp4651015p4651028.html Sent from the AspectJ - users mailing list archive at Nabble.com. ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users
Re: [aspectj-users] Behaviours of new constructor added by AspectJ ITD
Hi thanks! so it seems for Q1, it's apsecJ's limitation. Thank you for the information :) I'll post Q2 question in another thread. Regards! -- View this message in context: http://aspectj.2085585.n4.nabble.com/Behaviours-of-new-constructor-added-by-AspectJ-ITD-tp4651015p4651028.html Sent from the AspectJ - users mailing list archive at Nabble.com. ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users
Re: [aspectj-users] Behaviours of new constructor added by AspectJ ITD
For Q1: AspectJ compiler (and AJDT) will issue - inter-type constructor does not contain explicit constructor call: field initializers in the target type will not be executed [Xlint:noExplicitConstructorCall] when you don't have explicit constructor call. Can you post Q2 freshly in a separate thread? I am losing the context of what was originally asked and how the thread evolved. It is difficult to hold conversation on two different issues in the same thread. -Ramnivas On Mon, Jul 15, 2013 at 9:43 PM, pai pika...@gmail.com wrote: Dear ramnivas: Thank you for your detailed answer, but I have some follow-up questions. As regard to your answers. Q1: public class Child { public String name = John; public Child(String desc) { // TODO Auto-generated constructor stub } } If I new the Child with its original constructor: *Child(a child)* ,* its member variable will automatically initialized to John*, am I right? *But* with the ITD constructor, I'll have to initialize it explicitly like in your answer. And I really wanna know the reason for this, and is there anyway to avoid this explicit initialization? Q2: In your answer, you just call super() in your ITD constructor, this is not the case I asked. What causes exceptions is *super.someMethod()* And I need to wrap it in another ITD method, and call it from ITD constructor. Hope I clarify my questions this time! Thank you for all the help patience! -- View this message in context: http://aspectj.2085585.n4.nabble.com/Behaviours-of-new-constructor-added-by-AspectJ-ITD-tp4651015p4651023.html Sent from the AspectJ - users mailing list archive at Nabble.com. ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users
[aspectj-users] Behaviours of new constructor added by AspectJ ITD
Hi! folk~ I have a question about behaviours of new constructor added by AspectJ ITD I am currently applying AspectJ to our project, and I found a behavior which is a bit strange to me. **Q1:** I added a new constructor to my current class with inter-type declaration, and found that the class's member variable is not initialized if the new constructor is used to instantiate my class. For example: The class which I'll add a new constructor to: *public class Child { public String name = John; public Child(String name) { // TODO Auto-generated constructor stub } } * The aspectJ code: *public aspect MyTest { public Child.new(String name, int age) { System.out.println(Child Name: + this.name); } }* If I new the Child with the new constructor, the member variable name is not initialized as will be done with the original constructor. The result: * Child Name:null* Is this a limitation of AspectJ? Is there anyway to resolve this issue? I don't really want to add the code for member variable initialization to the new constructor. **Q2:** It seems in the newly added constructor, super.method() can not be correctly resolved. The workaround is to define another method for your class, and indirectly call the super.method() For example, if the Child extends Parent. *public class Parent { public final void init() { // } }* I'll have to add a new metohd, say *public void Child.initState() { super.init(); }* Or the following exception will be thrown. *Exception in thread main java.lang.NoSuchMethodError: com.test2.Child.ajc$superDispatch$com_test2_Child$init()V at MyTest.ajc$postInterConstructor$MyTest$com_test2_Child(MyTest.aj:19) at com.test2.Child.init(Child.java:1) at MainProgram.main(MainProgram.java:11)* Is this a limitation of AspectJ? Is this the only way to resolve this issue? Thank you all for your time :) You can also answer my questions on stackoverflow. Many thanks!! http://stackoverflow.com/questions/17647587/behaviours-about-new-constructor-added-by-aspectj-itd -- View this message in context: http://aspectj.2085585.n4.nabble.com/Behaviours-of-new-constructor-added-by-AspectJ-ITD-tp4651015.html Sent from the AspectJ - users mailing list archive at Nabble.com. ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users
Re: [aspectj-users] Behaviours of new constructor added by AspectJ ITD
Replied on stackoverflow. On Mon, Jul 15, 2013 at 8:03 AM, pai pika...@gmail.com wrote: Hi! folk~ I have a question about behaviours of new constructor added by AspectJ ITD I am currently applying AspectJ to our project, and I found a behavior which is a bit strange to me. **Q1:** I added a new constructor to my current class with inter-type declaration, and found that the class's member variable is not initialized if the new constructor is used to instantiate my class. For example: The class which I'll add a new constructor to: *public class Child { public String name = John; public Child(String name) { // TODO Auto-generated constructor stub } } * The aspectJ code: *public aspect MyTest { public Child.new(String name, int age) { System.out.println(Child Name: + this.name); } }* If I new the Child with the new constructor, the member variable name is not initialized as will be done with the original constructor. The result: * Child Name:null* Is this a limitation of AspectJ? Is there anyway to resolve this issue? I don't really want to add the code for member variable initialization to the new constructor. **Q2:** It seems in the newly added constructor, super.method() can not be correctly resolved. The workaround is to define another method for your class, and indirectly call the super.method() For example, if the Child extends Parent. *public class Parent { public final void init() { // } }* I'll have to add a new metohd, say *public void Child.initState() { super.init(); }* Or the following exception will be thrown. *Exception in thread main java.lang.NoSuchMethodError: com.test2.Child.ajc$superDispatch$com_test2_Child$init()V at MyTest.ajc$postInterConstructor$MyTest$com_test2_Child(MyTest.aj:19) at com.test2.Child.init(Child.java:1) at MainProgram.main(MainProgram.java:11)* Is this a limitation of AspectJ? Is this the only way to resolve this issue? Thank you all for your time :) You can also answer my questions on stackoverflow. Many thanks!! http://stackoverflow.com/questions/17647587/behaviours-about-new-constructor-added-by-aspectj-itd -- View this message in context: http://aspectj.2085585.n4.nabble.com/Behaviours-of-new-constructor-added-by-AspectJ-ITD-tp4651015.html Sent from the AspectJ - users mailing list archive at Nabble.com. ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users
Re: [aspectj-users] Behaviours of new constructor added by AspectJ ITD
Hi! thanks for the response. But it seems you have some misunderstanding about my questions. So I made some modifications to make it clear. Thank you for the help :) I am currently applying AspectJ to our project, and I found a behavior which is a bit strange to me. *Q1:* I added a new constructor to my current class with inter-type declaration, and found that the class's member variable is not initialized if the new constructor is used to instantiate my class. For example: The class which I'll add a new constructor to: public class Child { public String name = John; public Child(String desc) { // TODO Auto-generated constructor stub } } The aspectJ code: public aspect MyTest { public Child.new(String desc, int num) { System.out.println(Child Name: + this.name); } } If I instantiate the Child with the new constructor: new Child(A child, 5) the member variable **this.name** is not initialized as will be done with the original constructor. But, if I call the original constructor: new Child(A child) the member variable **this.name** will be initialized to John as usual The result: Child Name:null **Is this a limitation of AspectJ? Is there anyway to resolve this issue?** I don't really want to add the code for member variable initialization to the new constructor. *Q2:* It seems **in the newly added constructor**, **super.method()** can not be correctly resolved. The class which I'll add a new constructor to: public class Child extends Parent{ public String name = John; public Child(String desc) { } } **Child** extends **Parent**. **Parent** has a method **init()** public class Parent { public void init() { // } } I add a new constructor for the **Child** in my aspect. public aspect MyTest { public Child.new(String desc, int num) { super.init(); } } The above aspect code will trigger an exception. Exception in thread main java.lang.NoSuchMethodError: com.test2.Child.ajc$superDispatch$com_test2_Child$init()V at MyTest.ajc$postInterConstructor$MyTest$com_test2_Child(MyTest.aj:19) at com.test2.Child.init(Child.java:1) at MainProgram.main(MainProgram.java:11) My workaround is to define **another method** for my class **Child**, and indirectly call the super.method() within that method For example, add a new method that calls **super.init()** for **Child** public void Child.initState() { super.init(); } Now, I can call initState() in the newly added constructor like below: public aspect MyTest { public Child.new(String desc, int num) { this.initState(); } } **Is this a limitation of AspectJ? Is this the only way to resolve this issue?** Thank you all for your time :) -- View this message in context: http://aspectj.2085585.n4.nabble.com/Behaviours-of-new-constructor-added-by-AspectJ-ITD-tp4651015p4651019.html Sent from the AspectJ - users mailing list archive at Nabble.com. ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users
Re: [aspectj-users] Behaviours of new constructor added by AspectJ ITD
Hello. With all due respect: Ramnivas has answered the question before on SO quite patiently. So as not to waste any more of his precious time I recommend you to - read his answer, - think again, especially about Q1 and - learn some basic Java. Sorry if it sounds rude, but you seem not to appreciate his answer, which is also not very nice. Regards Alexander Am 15.07.2013 um 20:40 schrieb pai pika...@gmail.com: Hi! thanks for the response. But it seems you have some misunderstanding about my questions. So I made some modifications to make it clear. Thank you for the help :) I am currently applying AspectJ to our project, and I found a behavior which is a bit strange to me. *Q1:* I added a new constructor to my current class with inter-type declaration, and found that the class's member variable is not initialized if the new constructor is used to instantiate my class. For example: The class which I'll add a new constructor to: public class Child { public String name = John; public Child(String desc) { // TODO Auto-generated constructor stub } } The aspectJ code: public aspect MyTest { public Child.new(String desc, int num) { System.out.println(Child Name: + this.name); } } If I instantiate the Child with the new constructor: new Child(A child, 5) the member variable **this.name** is not initialized as will be done with the original constructor. But, if I call the original constructor: new Child(A child) the member variable **this.name** will be initialized to John as usual The result: Child Name:null **Is this a limitation of AspectJ? Is there anyway to resolve this issue?** I don't really want to add the code for member variable initialization to the new constructor. *Q2:* It seems **in the newly added constructor**, **super.method()** can not be correctly resolved. The class which I'll add a new constructor to: public class Child extends Parent{ public String name = John; public Child(String desc) { } } **Child** extends **Parent**. **Parent** has a method **init()** public class Parent { public void init() { // } } I add a new constructor for the **Child** in my aspect. public aspect MyTest { public Child.new(String desc, int num) { super.init(); } } The above aspect code will trigger an exception. Exception in thread main java.lang.NoSuchMethodError: com.test2.Child.ajc$superDispatch$com_test2_Child$init()V at MyTest.ajc$postInterConstructor$MyTest$com_test2_Child(MyTest.aj:19) at com.test2.Child.init(Child.java:1) at MainProgram.main(MainProgram.java:11) My workaround is to define **another method** for my class **Child**, and indirectly call the super.method() within that method For example, add a new method that calls **super.init()** for **Child** public void Child.initState() { super.init(); } Now, I can call initState() in the newly added constructor like below: public aspect MyTest { public Child.new(String desc, int num) { this.initState(); } } **Is this a limitation of AspectJ? Is this the only way to resolve this issue?** Thank you all for your time :) -- View this message in context: http://aspectj.2085585.n4.nabble.com/Behaviours-of-new-constructor-added-by-AspectJ-ITD-tp4651015p4651019.html Sent from the AspectJ - users mailing list archive at Nabble.com. ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users
Re: [aspectj-users] Behaviours of new constructor added by AspectJ ITD
Hi Alex! I'm sorry that you think I don't appreciate his answer. But actually, I do appreciate for your kind response. That's why I think I may not state my questions clear enough for people to understand clearly. It's my mistake. It seems my questions was misunderstood. I am quite familiar with Java, and that's why I know my questions are misunderstood. Could you spend some time reading my modified questions? I'd really thankful for your help! To make long story short: Q1: The class which I'll add a new constructor to: *public class Child { public String name = John; public Child(String desc) { // TODO Auto-generated constructor stub } } * The aspectJ code: *public aspect MyTest { public Child.new(String desc, int num) { System.out.println(Child Name: + this.name); } }* If I instantiate the Child with the new constructor: *new Child(A child, 5)* What's the output? What I saw is: *Child Name:null* Different from what I expected. Q2: The class which I'll add a new constructor to: *public class Child extends Parent{ public String name = John; public Child(String desc) { } } * *public class Parent { public void init() { // } }* I add a new constructor for the *Child *in my aspect. *public aspect MyTest { public Child.new(String desc, int num) { super.init(); } } * Can the code be compiled? What I encountered is an thrown exception: *Exception in thread main java.lang.NoSuchMethodError: com.test2.Child.ajc$superDispatch$com_test2_Child$init()V at MyTest.ajc$postInterConstructor$MyTest$com_test2_Child(MyTest.aj:19) at com.test2.Child.init(Child.java:1) at MainProgram.main(MainProgram.java:11)* Thanks for your patience! Alexander Kriegisch-2 wrote Hello. With all due respect: Ramnivas has answered the question before on SO quite patiently. So as not to waste any more of his precious time I recommend you to - read his answer, - think again, especially about Q1 and - learn some basic Java. Sorry if it sounds rude, but you seem not to appreciate his answer, which is also not very nice. Regards Alexander Am 15.07.2013 um 20:40 schrieb pai lt; pikapai@ gt;: Hi! thanks for the response. But it seems you have some misunderstanding about my questions. So I made some modifications to make it clear. Thank you for the help :) I am currently applying AspectJ to our project, and I found a behavior which is a bit strange to me. *Q1:* I added a new constructor to my current class with inter-type declaration, and found that the class's member variable is not initialized if the new constructor is used to instantiate my class. For example: The class which I'll add a new constructor to: public class Child { public String name = John; public Child(String desc) { // TODO Auto-generated constructor stub } } The aspectJ code: public aspect MyTest { public Child.new(String desc, int num) { System.out.println(Child Name: + this.name); } } If I instantiate the Child with the new constructor: new Child(A child, 5) the member variable **this.name** is not initialized as will be done with the original constructor. But, if I call the original constructor: new Child(A child) the member variable **this.name** will be initialized to John as usual The result: Child Name:null **Is this a limitation of AspectJ? Is there anyway to resolve this issue?** I don't really want to add the code for member variable initialization to the new constructor. *Q2:* It seems **in the newly added constructor**, **super.method()** can not be correctly resolved. The class which I'll add a new constructor to: public class Child extends Parent{ public String name = John; public Child(String desc) { } } **Child** extends **Parent**. **Parent** has a method **init()** public class Parent { public void init() { // } } I add a new constructor for the **Child** in my aspect. public aspect MyTest { public Child.new(String desc, int num) { super.init(); } } The above aspect code will trigger an exception. Exception in thread main java.lang.NoSuchMethodError: com.test2.Child.ajc$superDispatch$com_test2_Child$init()V at MyTest.ajc$postInterConstructor$MyTest$com_test2_Child(MyTest.aj:19) at com.test2.Child. init (Child.java:1) at MainProgram.main(MainProgram.java:11) My workaround is to define **another method** for my class **Child**, and indirectly call the super.method() within that method For example, add a new method that calls **super.init()** for
Re: [aspectj-users] Behaviours of new constructor added by AspectJ ITD
Replied again (appended to original answer). Hopefully, this resolves your issue. On Mon, Jul 15, 2013 at 12:27 PM, pai pika...@gmail.com wrote: Hi Alex! I'm sorry that you think I don't appreciate his answer. But actually, I do appreciate for your kind response. That's why I think I may not state my questions clear enough for people to understand clearly. It's my mistake. It seems my questions was misunderstood. I am quite familiar with Java, and that's why I know my questions are misunderstood. Could you spend some time reading my modified questions? I'd really thankful for your help! To make long story short: Q1: The class which I'll add a new constructor to: *public class Child { public String name = John; public Child(String desc) { // TODO Auto-generated constructor stub } } * The aspectJ code: *public aspect MyTest { public Child.new(String desc, int num) { System.out.println(Child Name: + this.name); } }* If I instantiate the Child with the new constructor: *new Child(A child, 5)* What's the output? What I saw is: *Child Name:null* Different from what I expected. Q2: The class which I'll add a new constructor to: *public class Child extends Parent{ public String name = John; public Child(String desc) { } } * *public class Parent { public void init() { // } }* I add a new constructor for the *Child *in my aspect. *public aspect MyTest { public Child.new(String desc, int num) { super.init(); } } * Can the code be compiled? What I encountered is an thrown exception: *Exception in thread main java.lang.NoSuchMethodError: com.test2.Child.ajc$superDispatch$com_test2_Child$init()V at MyTest.ajc$postInterConstructor$MyTest$com_test2_Child(MyTest.aj:19) at com.test2.Child.init(Child.java:1) at MainProgram.main(MainProgram.java:11)* Thanks for your patience! Alexander Kriegisch-2 wrote Hello. With all due respect: Ramnivas has answered the question before on SO quite patiently. So as not to waste any more of his precious time I recommend you to - read his answer, - think again, especially about Q1 and - learn some basic Java. Sorry if it sounds rude, but you seem not to appreciate his answer, which is also not very nice. Regards Alexander Am 15.07.2013 um 20:40 schrieb pai lt; pikapai@ gt;: Hi! thanks for the response. But it seems you have some misunderstanding about my questions. So I made some modifications to make it clear. Thank you for the help :) I am currently applying AspectJ to our project, and I found a behavior which is a bit strange to me. *Q1:* I added a new constructor to my current class with inter-type declaration, and found that the class's member variable is not initialized if the new constructor is used to instantiate my class. For example: The class which I'll add a new constructor to: public class Child { public String name = John; public Child(String desc) { // TODO Auto-generated constructor stub } } The aspectJ code: public aspect MyTest { public Child.new(String desc, int num) { System.out.println(Child Name: + this.name); } } If I instantiate the Child with the new constructor: new Child(A child, 5) the member variable **this.name** is not initialized as will be done with the original constructor. But, if I call the original constructor: new Child(A child) the member variable **this.name** will be initialized to John as usual The result: Child Name:null **Is this a limitation of AspectJ? Is there anyway to resolve this issue?** I don't really want to add the code for member variable initialization to the new constructor. *Q2:* It seems **in the newly added constructor**, **super.method()** can not be correctly resolved. The class which I'll add a new constructor to: public class Child extends Parent{ public String name = John; public Child(String desc) { } } **Child** extends **Parent**. **Parent** has a method **init()** public class Parent { public void init() { // } } I add a new constructor for the **Child** in my aspect. public aspect MyTest { public Child.new(String desc, int num) { super.init(); } } The above aspect code will trigger an exception. Exception in thread main java.lang.NoSuchMethodError: com.test2.Child.ajc$superDispatch$com_test2_Child$init()V at MyTest.ajc$postInterConstructor$MyTest$com_test2_Child(MyTest.aj:19) at com.test2.Child. init
Re: [aspectj-users] Behaviours of new constructor added by AspectJ ITD
Dear ramnivas: Thank you for your detailed answer, but I have some follow-up questions. As regard to your answers. Q1: public class Child { public String name = John; public Child(String desc) { // TODO Auto-generated constructor stub } } If I new the Child with its original constructor: *Child(a child)* ,* its member variable will automatically initialized to John*, am I right? *But* with the ITD constructor, I'll have to initialize it explicitly like in your answer. And I really wanna know the reason for this, and is there anyway to avoid this explicit initialization? Q2: In your answer, you just call super() in your ITD constructor, this is not the case I asked. What causes exceptions is *super.someMethod()* And I need to wrap it in another ITD method, and call it from ITD constructor. Hope I clarify my questions this time! Thank you for all the help patience! -- View this message in context: http://aspectj.2085585.n4.nabble.com/Behaviours-of-new-constructor-added-by-AspectJ-ITD-tp4651015p4651023.html Sent from the AspectJ - users mailing list archive at Nabble.com. ___ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users