Bug 84968 - [1.5][generics] Exception type handling broken in latest milestone
Summary: [1.5][generics] Exception type handling broken in latest milestone
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-10 22:39 EST by R Lenard CLA
Modified: 2005-05-11 10:20 EDT (History)
1 user (show)

See Also:


Attachments
Test case (1.09 KB, text/plain)
2005-03-11 15:24 EST, Olivier Thomann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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