Bug 48522 - Declare soft softening other exception types
Summary: Declare soft softening other exception types
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.1.1   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 1.2   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 52924 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-11 13:36 EST by Ron Bodkin CLA
Modified: 2004-02-24 10:32 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Bodkin CLA 2003-12-11 13:36:16 EST
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.
Comment 1 Ron Bodkin CLA 2003-12-11 14:24:35 EST
This is also a bug in HEAD.
Comment 2 Adrian Colyer CLA 2004-01-07 10:27:44 EST
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.
Comment 3 Adrian Colyer CLA 2004-02-24 10:32:04 EST
*** Bug 52924 has been marked as a duplicate of this bug. ***