Bug 89454

Summary: [1.5][compiler] Unexpected uncaught exception error with generic exception type.
Product: [Eclipse Project] JDT Reporter: Jesse Hull <jessehull>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Thrower.java
none
GenericsTest.java none

Description Jesse Hull CLA 2005-03-29 22:59:50 EST
I am using eclipse 3.1M5a with java 1.5 (detailed versions below)

Steps to reproduce:

1) Create the following two files (they must be seperate files if they are in
the same file this error does not occur)

In GenericsTest.java

class MyException extends Exception {
}

public class GenericsTest {
    public static void main(String[] args) throws MyException {
        Thrower<MyException> thrower = new Thrower<MyException>() {
            public void throwIt() throws MyException {
                throw new MyException();
            }
        };
        thrower.throwIt();
    }
}


In Thrower.java

public interface Thrower<E extends Exception> {
    public void throwIt() throws E;
}


2) When a clean build is done they compile fine. 
3) As soon as you edit GenericsTest.java the following compiler error appears:

Unhandled exception of type Exception on line 15 of GenericsTest.java



These two files compile correctly with javac 1.5

Windows Version: Windows XP SP2
Java version: build 1.5.0_01-b08
Eclipse Version: 3.1.0
Eclipse Build id: I20050219-1500
Comment 1 Jesse Hull CLA 2005-03-29 23:05:38 EST
Created attachment 19305 [details]
Thrower.java
Comment 2 Jesse Hull CLA 2005-03-29 23:06:34 EST
Created attachment 19306 [details]
GenericsTest.java
Comment 3 Philipe Mulet CLA 2005-03-30 08:12:08 EST
Added GenericTypeTest#test567

*** This bug has been marked as a duplicate of 83002 ***