Bug 89274 - [1.5][compiler] Enums in hierarchies with generics produces unnecessary warnings and errors
Summary: [1.5][compiler] Enums in hierarchies with generics produces unnecessary warni...
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:
: 91021 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-28 15:16 EST by Kory Markevich CLA
Modified: 2005-05-11 11:09 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kory Markevich CLA 2005-03-28 15:16:39 EST
Found in I20050308-0835.  The following code:

class A< T > {
    enum E { v1, v2; }
}

class B extends A< Integer >
{
    void a( A.E e )
    {
        b( e ); // Warning here
    }
    
    void b( E e )
    {
    }
}

Produces an unchecked conversion warning on the line indicated.  The same code
compiled with javac -Xlint:all produces no warnings.

I've also had a few cases where mixing enums in a hierarchy with generics
results in errors, which then disappear after a clean and rebuild is performed.
Comment 1 Philipe Mulet CLA 2005-04-07 09:28:40 EDT
Please provide testcases for all of them. Then each distinct issue should have a
separate defect.
Comment 2 Kory Markevich CLA 2005-04-07 20:58:40 EDT
I will, if I can manage to recreate them with a nice small code snippet.  The
one included above is as close as I've managed yet.
Comment 3 Philipe Mulet CLA 2005-04-15 08:19:02 EDT
Unchecked warning should only arise if non static type being considered.
Added EnumTest#test099.
Fixed
Comment 4 Philipe Mulet CLA 2005-04-15 08:20:31 EDT
will be released along with changes for bug 84496
Comment 5 Philipe Mulet CLA 2005-04-16 08:31:00 EDT
*** Bug 91021 has been marked as a duplicate of this bug. ***
Comment 6 Olivier Thomann CLA 2005-05-11 11:09:33 EDT
Verified in I20050510-0010