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
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
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
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&
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
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
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 à
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
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
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
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.
>
>
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
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
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,
>
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
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
16 matches
Mail list logo