Community
Participate
Working Groups
It appears that if you soften any exception in a scope, it actually softens ALL of them! Try this code: import java.sql.SQLException; public class Bad { public static void main(String args[]) { throw new Exception("should be a compiler error here"); } } aspect ExcPolicy { declare soft: SQLException: execution(* Bad.*(..)); } The compiler accepts this code when it should have a runtime error in compiling main... At a minimum, the declare soft implementation is softening more than it should be.
This is also a bug in HEAD.
The problem was that AjProblemReporter (which filters problems detected by the JDT compiler) was testing only the pointcut associated with a declare soft statement, and not also the exception type. This has now been fixed by ACAC.
*** Bug 52924 has been marked as a duplicate of this bug. ***