Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Point Cut gambling

Wes Isberg schrieb:

Frustrating - thanks to Ram and Gregor for the solution...

On the more general question of debugging pointcuts, if you're having trouble it helps to break them apart to isolate the problem. There's a long comment on point at

http://www.aspectcookbook.net/moin.cgi/DebugPointcutRecipe

I did what they say, but it's now much more confusing:

package de.prilmeier.mysabom.aspects.authorization;

import de.prilmeier.mysabom.addressbook.AddressBookDO;
import de.prilmeier.mysabom.addressbook.AddressBookManagerRemote;
import de.prilmeier.mysabom.party.PartyDO;

public abstract class AddressBookAuthorizationAspect
{
public pointcut remoteAuthOperations ( AddressBookManagerRemote iro, AddressBookDO ado ) : target ( AddressBookManagerRemote ) && target ( iro ) && args ( ado, * ) &&
       (
call ( public void AddressBookManagerRemote.addParty ( AddressBookDO, PartyDO ) ) || call ( public void AddressBookManagerRemote.removeParty ( AddressBookDO, PartyDO ) )
       );

declare warning: remoteAuthOperations ( AddressBookManagerRemote, AddressBookDO ) : "remoteAuthOperations matches";
}

Now I have a compiler error:

$ ant compile
Buildfile: build.xml

compile:
[iajc] F:\Inetpub\cvsroot\da-aop\source\mysabom\src\de\prilmeier\mysabom\aspects\authorization\AddressBookAuthorizationAspect.aj:14 [error] Syntax error on token ";", invalid PseudoToken
    [iajc] );
    [iajc]
    [iajc] MessageHolder:  (1 error)
    [iajc] [error   0]: error at );
    [iajc]
[iajc] F:\Inetpub\cvsroot\da-aop\source\mysabom\src\de\prilmeier\mysabom\aspects\authorization\AddressBookAuthorizationAspect.aj:14:0 Syntax error on token ";", invalid PseudoToken

BUILD FAILED
F:\Inetpub\cvsroot\da-aop\source\mysabom\build.xml:133: 1 errors

What's going on here? Is it not allowed to use "declare warning" in an abstract aspect? If I move the "declare warning" statement to an extending aspect, the compiler error vanishes (But there is no output "remoteAuthOperations matches").


Back to the top