Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Inter-Type constructor

I think in Java if you don't create a empty constructor, the compiler will do that. So, you are trying redefine a constructor already exists. If you try 'public Client.new(int x)' instead of 'public Client.new ()' you don't have any error. Maybe you can use 'Client around() : call(Client.new()) {...}' in your case.

Regards,
Rui Gonçalves

PS: sorry by bad english :)

On Dec 15, 2007 4:02 PM, Renato Rodrigues <renatolmsrodrigues@xxxxxxxxx> wrote:
I want to define the Client constructor in the aspect instead of the class itself. Shouldn't it be like this? The compiler says :
inter-type declaration from declare_question.X conflicts with existing member: void declare_question.Client.<init>()    ola/src/declare_question    X.aj    line 6   
------------------------------------------
package declare_question;


package declare_question;

public class Client {
   
    public static void main(String[] args) {
           Client o = new Client();
       }
}
--------------------------------------------------

package declare_question;

public aspect X {

    public Client.new(){
        System.out.println("cliente");
    }
}

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top