Bug 29689

Summary: Declare precedence should not allow multiple * patterns
Product: [Tools] AspectJ Reporter: Nicholas Lesiecki <ndlesiecki>
Component: CompilerAssignee: Jim Hugunin <jim-aj>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Nicholas Lesiecki CLA 2003-01-17 02:22:06 EST
The following precedence declaration is ambigous and should not be allowed:

public aspect Coordinator {
    declare precedence : *, Tracing, *;
}

To see why, examine the following example. Two aspects declare before advice on
doSomething(). Should Notification come before or after Tracing?

---
public class SomeObject {

    public static void main(String[] args) {
        new SomeObject().doSomething();
    }
    
    public void doSomething() {
        System.out.println("Finally doing something.");
    }
}

public aspect Tracing {

    before() : call(void doSomething()){
        System.out.println("Tracing: logging call.");
    }
}

public aspect Notification {

    before() : call(void doSomething()){
        System.out.println("Notification:" +
            " Sending update somewhere.");
    }
}

---
Comment 1 Jim Hugunin CLA 2003-01-21 14:03:03 EST
fixed in cvs, test in bugs/CircularPrecedence.java