Bug 48522

Summary: Declare soft softening other exception types
Product: [Tools] AspectJ Reporter: Ron Bodkin <rbodkin+LISTS>
Component: CompilerAssignee: Jim Hugunin <jim-aj>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2 CC: Antti.Karanta
Version: 1.1.1   
Target Milestone: 1.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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. ***