Bug 103051 - Declare Soft not Affecting Explicit Adviceexecution
Summary: Declare Soft not Affecting Explicit Adviceexecution
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 1.5.0RC1   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-07 14:03 EDT by Ron Bodkin CLA
Modified: 2012-04-03 16:08 EDT (History)
0 users

See Also:


Attachments
patch that makes performance acceptable on my test app (1.13 KB, patch)
2005-10-13 06:48 EDT, Ron Bodkin CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2005-07-07 14:03:58 EDT
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(* *(..));
Comment 1 Ron Bodkin CLA 2005-10-13 06:48:14 EDT
Created attachment 28224 [details]
patch that makes performance acceptable on my test app
Comment 2 Ron Bodkin CLA 2005-10-13 06:51:05 EDT
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.
Comment 3 Ron Bodkin CLA 2005-10-27 09:39:15 EDT
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!!
Comment 4 Adrian Colyer CLA 2005-11-22 04:06:30 EST
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.
Comment 5 Adrian Colyer CLA 2005-11-23 03:37:50 EST
fix now available