Skip to main content

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

It seems logically consistent that privileged aspects should be able to see pointcuts that aren’t otherwise visible to them. I suspect allowing for that would be a nontrivial effort, so to me it would be better to document the current semantics rather than spending effort revising this. What’s your use case for wanting this capability?

 


From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Gijs Peek
Sent: Wednesday, September 26, 2007 8:52 AM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] Bug? - Privileged aspect cannot access pointcutsoutside 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


Back to the top