Community
Participate
Working Groups
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(* *(..));
Created attachment 28224 [details] patch that makes performance acceptable on my test app
ok that BCException was from having an old version of the library jar in a web app. It's gone now I removed it. I am now able to start up without deadline when weaving the container. That performance patch is critical though.
The patch & comments here are due to Bugzilla's weird habit of prompting you to edit a different bug after you submit something for one. They don't apply to this bug. However, this should be a P1 or P2 bug in my mind: declare soft should work properly in 1.5.0 final!!
The problem was that EclipseShadow was building a method-execution shadow for the adviceexecution member, which then was not correctly matched by AjProblemReporter when determining whether or not to suppress unhandledException warnings. Now fixed in tree... waiting for build.
fix now available