Bug 234815 - [compiler][1.5] compiler difference to javac involving a parameterized constructor that throws its parameter type
Summary: [compiler][1.5] compiler difference to javac involving a parameterized constr...
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.4 RC3   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-30 06:56 EDT by Maxime Daniel CLA
Modified: 2008-05-30 13:10 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Daniel CLA 2008-05-30 06:56:33 EDT
v_871

On GenericTypeTest#1149, eclipse compiles OK while javac (1.5 to 7) fail.

Source:
public class A {
    <T extends Throwable> A() throws T {}
    void a() throws ClassNotFoundException {
	    new<ClassNotFoundException> A();
    }
}

javac error message:
A.java:4: unreported exception T; must be caught or declared to be thrown
	    new<ClassNotFoundException> A();
            ^
1 error
Comment 1 Maxime Daniel CLA 2008-05-30 07:00:05 EDT
We believe that this is a javac bug (could not find a matching one though), especially since the following test case, added as GenericTypeTest#1149a, passes:
public class A {
    <T extends Throwable> void foo() throws T {}
    void a() throws ClassNotFoundException { 
	   new A().<ClassNotFoundException>foo();
    }
}

(the difference here being that a regular method is involved instead of a constructor).

Closing as javac bug.
Comment 2 Jerome Lanneluc CLA 2008-05-30 13:10:46 EDT
Verified for 3.4RC3