To finish off on this problem. I raised it as bug 209019 and it is now fixed in the repository and will be in a dev build shortly. It is the combination of concrete aspect in XML + around advice in a code style abstract superaspect + advice being inlined.
A workaround until the dev build is available is to specify -XnoInline in the aop.xml weaver options section: <weaver options="-XnoInline"/> You can use "&&" or "AND" in your aop.xml pointcut expression. cheers, Andy. On 07/11/2007, Andy Clement <[EMAIL PROTECTED]> wrote: > we actually use AND in the case of writing composite expressions in > XML, rather than && - see the documentation: > http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html > > I still don't think it should fail in a horrible way like that, > whatever you specified. > > Andy. > > On 07/11/2007, Jean-Louis PASTUREL <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > > > > Objet : [Fwd: Re: [aspectj-users] (no subject)] > > > > > > Looks like a bug to me, if you raise it in bugzilla I will look into it. > > > > > > Andy > > > > > > On 06/11/2007, Jean-Louis PASTUREL wrote: > > > > Hi, > > > > Sorry for the lengh of this post ! > > > > I create an abstract Aspect like this : > > > > > > > > package iep.perf; > > > > > > > > import java.util.Calendar; > > > > import java.io.File; > > > > > > > > public abstract aspect AbstractDurationMethod { > > > > private static String rootTrace = ""; > > > > > > > > private static Trace outDurationMethods; > > > > static { > > > > rootTrace = System.getProperty("rootTrace"); > > > > > > > > outDurationMethods = new Trace(rootTrace + File.separator > > > > + "outDurationMethods.log"); > > > > } > > > > > > > > public abstract pointcut methods(); > > > > > > > > Object around(): methods() { > > > > long deb = Calendar.getInstance().getTimeInMillis(); > > > > > > > > Object retour= proceed(); > > > > long fin = Calendar.getInstance().getTimeInMillis(); > > > > outDurationMethods.append(outDurationMethods.getSdf().format( > > > > Calendar.getInstance().getTime()) > > > > + ";JointPoint =" > > > > + thisJoinPoint.getSignature().getDeclaringTypeName() > > > > + "." > > > > + thisJoinPoint.getSignature().getName() > > > > + ";duration=" > > > > + (fin - deb) + " ms\n"); > > > > outDurationMethods.flush(); > > > > return retour; > > > > } > > > > > > > > } > > > > > > > > I use classes Square and Circle found in eclipse documentation to test > > my > > > > aspects > > > > > > > > When i try this aspect with concrete-aspect tag in aop.xml : > > > > > > > > > > extends="iep.perf.AbstractDurationMethod"> > > > > > > expression="within(jlp.exemple1.*) && call (public * > > > > jlp..*(..))" /> > > > > > > > > > > > > I get this error : > > > > Exception in thread "main" java.lang.IllegalAccessError: tried to access > > > > method > > > > > > iep.perf.AbstractDurationMethod.ajc$around$iep_perf_AbstractDurationMethod$1$cd1 > > > > > > 02c33proceed(Lorg/aspectj/runtime/internal/AroundClosure;)Ljava/lang/Object; > > > > fro > > > > m class jlp.exemple1.Main > > > > at > > > > > > jlp.exemple1.Main.perimeter_aroundBody1$advice(Main.java:124) > > > > at > > > > jlp.exemple1.Main.perimeter_aroundBody2(Main.java:1) > > > > at jlp.exemple1.Main$AjcClosure3.run(Main.java:1) > > > > at > > > > > > iep.perf.AbstractDurationMethod.ajc$around$iep_perf_AbstractDurationMethod$1$cd102c33proceed(AbstractDurationMethod.aj:1) > > > > at > > > > > > iep.perf.AbstractDurationMethod.ajc$around$iep_perf_AbstractDurationMethod$1$cd102c33(AbstractDurationMethod.aj:24) > > > > at jlp.exemple1.Main.main(Main.java:8) > > > > > > > > When I extend my Abstract Aspect like this : > > > > package iep.perf; > > > > > > > > public aspect ConcreteDurationMethod extends AbstractDurationMethod { > > > > > > > > public pointcut methods():within(jlp.exemple1.*) && call (public * > > > > jlp..*(..)); > > > > > > > > } > > > > > > > > and modify my aop.xml like below : > > > > > > > > it runs fine ! > > > > But that i want is to use concrete-aspect tag. > > > > I use AspectJ 1.5.4 embedded in Eclipse Europa 3.3.1 Build id: > > > > M20070921-1145 > > > > > > > > Do you think that is a bug, or otherwise what did i miss ? > > > > Thanks > > > > JLP > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > aspectj-users mailing list > > > > [email protected] > > > > https://dev.eclipse.org/mailman/listinfo/aspectj-users > > > > > > > > > > > > > --------------------------------------------------------------------------------------- > > > Orange vous informe que cet e-mail a ete controle par l'anti-virus mail. > > > Aucun virus connu a ce jour par nos services n'a ete detecte. > > > > > > > > > > > > > > > > Using concrete-aspect tag with the schema below it works ! > > <aspectj> > > > > <aspects> > > <concrete-aspect name="iep.perf.DurationMethod" > > extends="iep.perf.AbstractDurationMethod"> > > <pointcut name="methods" > > expression="call (public * jlp..*(..))" /> > > </concrete-aspect> > > > > </aspects> > > > > > > <weaver> > > <include within="jlp.exemple1.*"/> > > > > </weaver> > > > > </aspectj> > > > > It seems that the expession attribute of concrete-aspect tag doesn't support > > a composite expession like "within(jlp.exemple1.*) && call (public * > > jlp..*(..))" > > Putting the include element inside weaver tag solves the problem. > > Is-it a limitation or an AspectJ bug ? > > If it is, i will write a bug... > > Best Regards > > > > > > _______________________________________________ > > 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
