Community
Participate
Working Groups
If a class which uses generics has a public inner class which extends Exception if there is ever a case where the exception needs to be caught in a different class, even when the exception is caught in a try catch block the following two errors show in the Problems View: Unhandled exception type TestClass<String>.MyException Tester.java TestProject/com/test line 9 September 9, 2005 2:47:41 AM Unreachable catch block for TestClass<T>.MyException. This exception is never thrown from the try statement body Tester.java TestProject/com/test line 10 September 9, 2005 2:47:41 AM It would appear that the eclipse compiler doesn't understands that TestClass<String>.MyException and TestClass<T>.MyException are the same thing. Tested with the Sun 1.5 JDK compiler and it compiles without error and runs as well. Example Test Case is as follows: TestClass.java: package com.test; public class TestClass<T> { public TestClass() throws MyException { throw new MyException(); } public class MyException extends Exception { public MyException() { super(); } } } Tester.java: package com.test; import com.test.TestClass.MyException; public class Tester { public static void main(String[] args) { try { TestClass<String> test = new TestClass<String>(); } catch (MyException e) { e.printStackTrace(); } } }
Type import should perform raw conversion on leading types. Added GenericTypeTest#test839
Fixed both in 3.2 (HEAD) stream and 3.1 maintenance stream.
*** Bug 110806 has been marked as a duplicate of this bug. ***
Reopen for 3.1.2 verification
We need to verify that's this bug fix is really fixed in R3_1_maintenance stream before 3.1.2 delivery...
Verified for 3.1.2 in M20060109-0800.
Verified for 3.2M4 in I20051215-1506