Project: AspectJ
Bug 103051 Declare Soft not Affecting Explicit Adviceexecution
Reported: 2005-07-07 14:03:58 | Status: resolved fixed

The following aspect should compile successfully: import java.io.IOException; public aspect SoftenAdvice { declare soft: IOException: within(SoftenAdvice) && adviceexecution(); before() : execution(* main(..)) { throw new IOException("test"); } public static void main(String args[]) { } } But both 1.5.0M2 and HEAD (from 2 days ago) give this output: C:\devel\scratch\err>ajc SoftenAdvice.aj C:\devel\scratch\err\SoftenAdvice.aj:7 [error] Unhandled exception type IOExcept ion throw new IOException("test"); ^^^^^^^^^^^^^^^^^^^^ 1 error However if you change the declare soft to be the following, it correctly softens at the advice execution join point. declare soft: IOException: within(SoftenAdvice) && !withincode(* *(..));

Files changed in fix:
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseShadow.java tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java