}
aspectDecl.modifiersSourceStart = intStack[intPtr--];
aspectDecl.modifiers = intStack[intPtr--];
+ if (isPrivileged) {
+ aspectDecl.modifiersSourceStart = intStack[intPtr--];
+ aspectDecl.modifiers |= intStack[intPtr--];
+ }
if (aspectDecl.modifiersSourceStart >= 0) {
aspectDecl.declarationSourceStart = aspectDecl.modifiersSourceStart;
}
<message kind="error" line="8"/>
</compile>
</ajc-test>
+
+ <ajc-test dir="bugs"
+ pr="46280"
+ title="compiler issues error on inner aspects when privilieged">
+ <compile files="PrivilegedParsing.java"/>
+ <run class="PrivilegedParsing"/>
+ </ajc-test>
<ajc-test dir="bugs" pr="44586"
title="After throwing advice on ctors doesn't execute for inter-type decl field inits">
--- /dev/null
+public class PrivilegedParsing {
+ private int hidden;
+ public int visible;
+ public PrivilegedParsing(int priv, int pub) {
+ hidden = priv;
+ visible = pub;
+ }
+ public void doSomething() {
+ System.out.println("" + hidden + ", " + visible + "");
+ }
+ public static void main(String[] args) {
+ PrivilegedParsing capsule = new PrivilegedParsing(1, 1);
+ capsule.doSomething();
+ }
+}
+
+aspect Outer {
+ static privileged //<== JUST TRY TO UNCOMMENT THIS!
+ aspect Inner {
+ pointcut call2doSomething(PrivilegedParsing capsule):
+ call(void PrivilegedParsing.doSomething())
+ && target(capsule);
+ before(PrivilegedParsing capsule): call2doSomething(capsule) {
+ capsule.visible++;
+ capsule.hidden++;
+ }
+ }
+}
+
+interface Marker {
+ static privileged //<== JUST TRY TO UNCOMMENT THIS!
+ aspect Inner {
+ pointcut call2doSomething(PrivilegedParsing capsule):
+ call(void PrivilegedParsing.doSomething())
+ && target(capsule);
+ before(PrivilegedParsing capsule): call2doSomething(capsule) {
+ capsule.visible++;
+ capsule.hidden++;
+ }
+ }
+}
\ No newline at end of file