Community
Participate
Working Groups
Currently, the following code compiles, but it rather should not. The problem is that the before advice declares to throw a checked exception but is woven into a context that does not handle this exception: there is no try/catch block, and neither does foo declare the Exception in its signature. import java.io.IOException; public aspect A { before() throws Exception: handler(IOException) { throw new Exception("gotcha!"); } public static void foo() { try { throw new IOException(); } catch (IOException e) { } } public static void main(String[] args) { foo(); } } The problem is correctly handled for other pointcuts like "call", but not for "handler". (static/pre)initialization pointcuts may be problematic, too.