Community
Participate
Working Groups
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
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.
Verified for 3.4RC3