Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] hanging problem with aspectj 1.1

Dominik,

I think it's more complicated than what you reported. I suspect your pointcut is causing an infinite chain of advice (i.e., it's matching something called directly or indirectly by your advice). You could try writing execution(* *(..)) && !within(Tracing)

However, the following code compiles and runs without hanging for me with ajc 1.1.0:

abstract aspect Tracing 
{
 abstract pointcut trace();
 before(): trace() {}
 after(): trace() {}
}


public aspect MethodTracing extends Tracing
{
 pointcut trace(): execution(* *(..));

 public static void main(String args[]) {
  foo();
 }
 private static void foo() {}
}

Ron Bodkin
Chief Technology Officer
New Aspects of Security
m: (415) 509-2895

> ------------Original Message-------------
> From: "Dominik Dahlem" <Dominik.Dahlem@xxxxxxxxx>
> To: <aspectj-users@xxxxxxxxxxx>
> Date: Mon, Jul-28-2003 9:23 AM
> Subject: [aspectj-users] hanging problem with aspectj 1.1
> 
> Hi all,
> 
> I'm new to aspectj and ran into a hanging problem. 
> I searched google and this mailing list, but couldn't find 
> a hint. I'd like to implement a tracing aspect for my project. 
> However, this aspect hangs if I specify a pointcut for 
> public/protected/private methods. Everything works fine, 
> if I only specify the pointcut for public methods. In fact, 
> I tested my aspects with a HelloWorld class with only 
> public methods. But I assume this shouldn't be the problem. 
> Are there any issues or am I missing something?
> 
> My aspect defs are:
> 
> public abstract aspect Tracing 
> {
>   abstract pointcut trace();
>   before(): trace() {}
>   after(): trace() {}
> }
> 
> 
> => this aspect hangs.
> public MethodTracing extends Tracing
> {
>   pointcut trace(): execution(* *(..));
> }
> 
> => this aspect works find.
> public MethodTracing extends Tracing
> {
>   pointcut trace(): execution(public * *(..));
> }
> 
> 
> Any help is greatly appreciated.
> Dominik
> 
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 


Back to the top