Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Bug? - Privileged aspect cannot access pointcuts outside visible scope

Hi,

I noticed that privileged aspects do not seem to be able to access pointcuts that lie outside of their visible scope, e.g. writing the following aspects:

public aspect A {

private pointcut p():call (* *(..));

}

public privileged aspect B {

after():A.p() {

doStuff();

}

}

generates a compile error (using ajc 1.5.3):

B.aj:2 [error] pointcut declaration pointcut A.p() is not accessible

The semantics section in the AspectJ programming guide state that

"A named pointcut may be defined in either a class or aspect, and is treated as a member of the class or aspect where it is found."

and

"Code in priviliged aspects has access to all members, even private ones." (The spelling error also occurs in the original)

Which would lead to the conclusion that privileged aspects should also be able to access all pointcuts. Is this a bug?

regards,

- Gijs Peek

Attachment: signature.asc
Description: This is a digitally signed message part.


Back to the top