Bug 28921

Summary: Verify error on non-Throwable in declare soft 1.1b2
Product: [Tools] AspectJ Reporter: Nicholas Lesiecki <ndlesiecki>
Component: CompilerAssignee: Jim Hugunin <jim-aj>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Nicholas Lesiecki CLA 2002-12-30 21:09:41 EST
Command:
ajc -Xlint -sourceroots simple && java simple/Except

Error:

Exception in thread "main" java.lang.VerifyError: (class: simple/Except, method:
<clinit> signature: ()V) catch_type not a subclass of Throwable

Class:

package simple;

public class Except {

    public static void a(){
        b();
    }
    /**
     * Method b.
     */
    private static void b() {
        throw new RuntimeException("Orig");
    }
    
    public static void main(String[] args) {
        try {
            a();
        } catch (SoftException e) {
            System.out.println(e.getWrappedThrowable());
        }
    }
    
    public static interface Checked{
    }
    
    static aspect Softner{
        declare parents : Exception+ && !RuntimeException implements Checked;
        declare soft : Checked : within(Except);
    }
}
Comment 1 Jim Hugunin CLA 2003-01-07 16:08:31 EST
fixed in cvs tree, test case at tests/bugs/DeclareSoftCf.java