Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Another privileged bug

I was trying to restrict the part of an aspect that is privileged through
the use of inner privileged aspects, but the compiler complains that "inner
aspects must be static" whenever I try to qualify an inner (and static)
aspect as privileged, no matter what the enclosing type is (aspect,
interface or class):
------------------
BASE CLASS:
public class Capsule {
private int hidden;
public  int visible;
public Capsule(int priv, int pub) {
hidden = priv;
visible = pub;
}
public void doSomething() {
System.out.println(""" + hidden + ", " + visible + """);
}
public static void main(String[] args) {
Capsule capsule = new Capsule(1, 1);
capsule.doSomething();
}
}
------------------
ASPECT:
public aspect Outer {
static //privileged  <== JUST TRY TO UNCOMMENT THIS!
aspect Inner {
pointcut call2doSomething(Capsule capsule):
call(void Capsule.doSomething())
&& target(capsule);
before(Capsule capsule): call2doSomething(capsule) {
capsule.visible++;
//capsule.hidden++;
}
}
}
------------------
INTERFACE:
public interface Marker {
static //privileged  <== JUST TRY TO UNCOMMENT THIS!
aspect Inner {
pointcut call2doSomething(Capsule capsule):
call(void Capsule.doSomething())
&& target(capsule);
before(Capsule capsule): call2doSomething(capsule) {
capsule.visible++;
//capsule.hidden++;
}
}
}
------------------
I was using j2sdk1.4.0_02, AspectJ 1.1, eclipse 2.1 (with AJDT 1.1.3) as
with the other privileged bug I reported.
BTW, the reason I still use eclipse 2.1 instead of 3.0 is due to a problem
with the AspectJ/Java editor: code inside comments also appears with syntax
highlighting, instead of single-colour. This only happened to me with
eclipse 3.0. Hasn't that happened with anyone else?
------------------
I tried to silently report this bug, but there was something wrong with the
Bugzilla. It did not accept my password, and when I tried to change it
(following the "Bugzilla Change Password Request") I got back an error page
(another bug, perhaps? ;-)):


--
Miguel J. T. Pessoa Monteiro
Ph.D. student Minho University, Portugal
eMail: mpm@xxxxxxxxxxx
URL: http://gec.di.uminho.pt/mpm/



Back to the top