Bug 235505

Summary: parsing errors on privileged generic aspect
Product: [Tools] AspectJ Reporter: charles <czhang>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: P2 CC: aclement
Version: 1.6.0   
Target Milestone: 1.6.1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description charles CLA 2008-06-03 22:39:01 EDT
The following aspect definition gives a parsing error:

public privileged abstract aspect<T> {

}
Comment 1 Andrew Clement CLA 2008-06-05 12:33:48 EDT
probably needs a parser regen - yuck
Comment 2 Andrew Clement CLA 2008-06-09 23:31:40 EDT
yep, just looked and it requires a grammar change.
Comment 3 Andrew Clement CLA 2008-06-10 15:11:25 EDT
fixed!  I'm a hero - and decided to upgrade the grammar to support this.  This is my testcase:

privileged abstract aspect A<T> {
  public void foo(T t) { System.out.println(t); }
  before(T t): execution(* *(..)) && args(t) && !within(A+) { foo(t); }
}

aspect X extends A<String> {}

public class B {
  public static void main(String []argv) {
    new B().run("Hello World");
  }

  public void run(String s) {
    System.out.println(s);
  }
}

It doesn't exploit the fact that the aspect is privileged, but it does compile and run OK.

Fix will be in next dev build.

Just a note that the original declaration in the bug report is missing an actual type name (it should be 'aspect Something<T>' and not just 'aspect<T>' - but I know what you meant ;) )
Comment 4 charles CLA 2008-06-10 23:44:56 EDT
Andy, don't know how to thank you. I will verify this for the next dev. build.