aspectj pointcut pre metody lubovolnej triedy okrem metod z anonymous inner classes

Peter Kvokacka kvokacka na vsl.sk
Pátek Březen 19 20:51:01 CET 2010


Ahojte
odpoviem si sam, ak by sa to niekomu zislo.
Pytal som sa na aspectj-users at eclipse.org 
<https://dev.eclipse.org/mailman/listinfo/aspectj-users>. Existuje roky 
stary (2004) navrh, ktory by umoznoval taketo riesenie:

pointcut all(): execution(* *.*(..))&&  !within(anonymous *);

avsak vo verzii AspectJ 1.6.8 to nie je podporovane.
Mal som vsak to stastie, ze Andy Clement zaradil do noveho dev. release 
rozsirenie ktore umoznuje zapisat pointcut v takomto tvare:

pointcut all(): execution(* *.*(..))&&  !within(is(AnonymousType));


funguje super, snad sa teda dostane aj do stable release.

see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=44365#c10

Peter

On 16. 3. 2010 19:29, Peter Kvokacka wrote:
> Dobry den
>
> vie niekto poradit co pridat k
>     pointcut all() : execution(* *.*(..))
> ak chcem vylucit metody z anonymous inner classes ?
>
> Google mlci jedine co som nasiel bol posledny komentar k bugu 
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=73050#c6
>
>> Adrian Colyer 2005-11-04 08:15:01 EST
>> I've just commited the fix for this and it will be available in the next
>> published build. Anonymous types are
>> now only matched by the name pattern "*" - any other pattern fails to match
>> since anonymous types are
>> treated as having no name.
>
> skusal som
>     pointcut all() : execution(* *.*(..)) && !within(*.*)
>
> to zafunguje prekvapivo iba pre triedy, ktore su v rovnakom package 
> ako aspect. Ine zufale pokusy neuvadzam aby som Vas neovplyvnoval :).
>
> Peter
>

------------- další část ---------------
HTML příloha byla odstraněna...
URL: <http://amaio.cz/pipermail/konference/attachments/20100319/5726a534/attachment.htm>


Další informace o konferenci Konference