Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Re: [Bug 30439] spurious "circular dependency " error

Doug Orleans wrote:
> I'm not feeling very imaginative; can anyone come up with an example
> where the ordering of `before' vs. `after' advice is observable?

Here's one:

before() throws IOException: fileOp() {
    logStream = new FileOutputStream("log");
    ...
}

after() throwing (IOException ioe): fileOp() {
    handleException(ioe);
} 

If the after is more precedent, then it will act as if it is "outside" of the before and any exceptions thrown by the "new FileOutputStream" call will be seen by the after throwing advice.  However, if the after is less precedent, then it is "inside" the before and will not see any exceptions thrown by the before.

-Jim


Back to the top