Bug 29689 - Declare precedence should not allow multiple * patterns
Summary: Declare precedence should not allow multiple * patterns
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-17 02:22 EST by Nicholas Lesiecki CLA
Modified: 2003-01-21 14:03 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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