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 <[email protected]> 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
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to