Bug 84968

Summary: [1.5][generics] Exception type handling broken in latest milestone
Product: [Eclipse Project] JDT Reporter: R Lenard <rlenard>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mlists
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Test case none

Description R Lenard CLA 2005-02-10 22:39:56 EST
It might also be broken earlier but this is the first code snippet I've seen 
with the problem.

This code compiles fine with javac, but I get these errors.
Severity	Description	Resource	In Folder	Location
	Creation Time
2	Cannot use the parameterized type Test.Ex1 either in catch block or 
throws clause	Test.java	fooey/src	line 14	February 11, 2005 
2:36:13 PM
2	si cannot be resolved	Test.java	fooey/src	line 16
	February 11, 2005 2:36:13 PM

As you can see it's only in the case of the "static" exception - not the bound 
inner one.


% cat Test.java
public class Test<E>
 {
    public static final class Ex1 extends Exception
    {
        private static final long serialVersionUID = 1;
    }

    private void a1()
    {
        try
        {
            a1_1();
        }
        catch (Ex1 si)
        {
            assert si != null;
        }
    }

    protected Object a1_1() throws Ex1
    {
        return null;
    }

    private void a2()
    {
        try
        {
            a2_1();
        }
        catch (Ex2 si)
        {
            assert si != null;
        }
    }

    protected Object a2_1() throws Ex2
    {
        return null;
    }

    public final class Ex3 extends Exception
    {
        private static final long serialVersionUID = 1;
    }

    private void a3()
    {
        try
        {
            a3_1();
        }
        catch (Ex3 si)
        {
            assert si != null;
        }
    }

    protected Object a3_1() throws Ex3
    {
        return null;
    }

}

final class Ex2 extends Exception
{
    private static final long serialVersionUID = 1;
}
Comment 1 R Lenard CLA 2005-02-10 22:40:22 EST
Actually it's broken in the 8th Feb build too.
Comment 2 Olivier Thomann CLA 2005-03-11 15:24:35 EST
Created attachment 18715 [details]
Test case

It still fails with latest.
Comment 3 Philipe Mulet CLA 2005-05-09 07:47:58 EDT
Added GenericTypeTest#test637.
Problem comes from parameterized type generated to represent static member of
raw type.
Fixed in latest.
Comment 4 Olivier Thomann CLA 2005-05-11 10:20:44 EDT
Verified in I20050510-0010