Re: [aspectj-users] Matching on one of an annotation's values in a multivalued property?

2013-04-05 Thread Romain MULLER
I could not agree more. Sugared variant is wrong and misleading, violates the rule of least surprise since it overloads "=" with something other than either "assign" or "equals" (namely "contains/includes"). _ Sent over RFC-1149 compliant transport - please excuse occasionn

Re: [aspectj-users] context information in aspect fields

2012-11-06 Thread Romain Muller
Yes. And for non-static members you ought not to forget the use of volatile for the member... ;) [ Romain Muller | Software Development Engineer | +33 (0)6 48 25 66 70 | romain.mul...@esial.net ] Le 6 nov. 2012 à 11:47, Reik Schatz a écrit : > Thanks, both approaches are good i th

Re: [aspectj-users] context information in aspect fields

2012-11-06 Thread Romain Muller
You can't do this with a "final" TIMER field. You may want to have a "private final Map timers" in which you'd associate Timers to MethodNames. The MethodName you can get from thisJoinPoint(StaticPart) - you may even be able to use thisJoinPointStaticPart.toString

Re: [aspectj-users] Problems with a basic staticinitialization pointcut in AJDT and Maven

2012-10-26 Thread Romain MULLER
t;>> >>> On 25 October 2012 08:24, Timothy Armstrong wrote: >>>> >>>> Hello, >>>> >>>> Thanks for your replies. Yes, I get the same behavior when I put version >>>> 1.6.11 in the POM, just without the "bad version number&

Re: [aspectj-users] Problems with a basic staticinitialization pointcut in AJDT and Maven

2012-10-24 Thread Romain MULLER
I surely am no maven guru and I won't risk myself in trying to comment your POM. That said, on the Maven error, I think the following line could be of some relevance: [WARNING] bad version number found in /home/tim/.m2/repository/org/aspectj/aspectjrt/1.7.0/aspectjrt-1.7.0.jar expected 1.6.11 foun

Re: [aspectj-users] Intercepting field access and thread-safety

2012-10-19 Thread Romain Muller
Yes! Right :) And there is no point in fiddling with proceedingJoinPoint.proceed(); when you use .aj files (as opposed to annotated-pojo-based), it's not wired to anything. Regards, [ Romain Muller | Software Development Engineer | +33 (0)6 48 25 66 70 | romain.mul...@esial.net ] Le 1

Re: [aspectj-users] Intercepting field access and thread-safety

2012-10-19 Thread Romain Muller
BTW - I think it'd be good practice to exclude final fields from your advice, and possibly declare a warning when a final field is annotated with your marker annotation. [ Romain Muller | Software Development Engineer | +33 (0)6 48 25 66 70 | romain.mul...@esial.net ] Le 19 oct. 2012 à

Re: [aspectj-users] Intercepting field access and thread-safety

2012-10-18 Thread Romain MULLER
You'll want to use: around(Object val) : get(@Annotation * *.*) && args(val) {...} _ Sent over RFC-1149 compliant transport - please excuse occasionnal packet loss Le 19 oct. 2012 à 08:09, "Sertic Mirko, Bedag" a écrit : > Hi Andy > > No problem, and yes, this is exactl

Re: [aspectj-users] A way to generate a static arrays of annoted classes.

2012-08-14 Thread Romain Muller
In a way, that looks a bit like a problem that may be better solved using APT (Annotation Processing Toolkit) and Java SPI (Service Provider Interfaces). Essentially, you'd use APT tools to compile-time list all classes with your annotation and dump their names in the appropriate file in META-IN

Re: [aspectj-users] Getting time of invocation from return

2012-08-09 Thread Romain Muller
It appears to me that what you're really trying to achieve is what an "around" advise is made for... around() : SomePointCut() { final long startTime = System.currentTimeInMillis(); proceed(); System.out.println("Call to " + thisJoinPoint + " took " + (System.currentTimeI

Re: [aspectj-users] Duplicate entries in logging in AspectJ

2012-08-09 Thread Romain Muller
What does the advise(s) look like? -Romain. Le 9 août 2012 à 11:18, Jeevitha Muthusamy a écrit : > Hi, > We are using AspectJ to log the trace of our API execution. > When enabling Aspects we receive duplicate entries of messages. > We are not using any framework or annotations. > >

Re: [aspectj-users] Pointcut not being executed...

2012-08-02 Thread Romain MULLER
EntityManager.persist() accepts an Obect argument. This static typing is all that AspectJ will look at. You will have to intercept *all* calls to the method, regardless of the argument type, then inspect thisJoinPoint.getArgs()[0] to see if it's the type you're looking for, and acting if it is the

Re: [aspectj-users] Advising javax.persistence.EntityManager with AspectJ not working

2012-08-02 Thread Romain Muller
ead: execution(* javax.persistence.EntityManager+.persist(..)); [ Romain Muller | Software Development Engineer | +33 (0)6 48 25 66 70 | romain.mul...@esial.net ] Le 2 août 2012 à 15:55, Julien Martin a écrit : > Using "call" works and "execution" does not. > Thanks a lot Romain

Re: [aspectj-users] Advising javax.persistence.EntityManager with AspectJ not working

2012-08-02 Thread Romain Muller
Have you tried switching your pointcut from "execution" to "call" and see if that works any better? [ Romain Muller | Software Development Engineer | +33 (0)6 48 25 66 70 | romain.mul...@esial.net ] Le 2 août 2012 à 15:49, Julien Martin a écrit : > Hello, >

Re: [aspectj-users] Keeping advice code DRY when using ambiguous bindings

2012-07-28 Thread Romain MULLER
urn pjp.proceed()" in the place of "pjp.proceed()" help? -B. ------ *From:* Romain Muller *To:* aspectj-users@eclipse.org *Sent:* Friday, July 27, 2012 5:46 PM *Subject:* [aspectj-users] Keeping advice code DRY when using ambiguous bindings Hi, Given the

[aspectj-users] Keeping advice code DRY when using ambiguous bindings

2012-07-27 Thread Romain Muller
eption { pjp.proceed(); } }); } But it turns out that when I do this, "pjp.proceed()" does nothing. Is there anything i'm doing wrong. Other than that, is there a way I could write a single advice that'd advise the four cas