Bug 89274

Summary: [1.5][compiler] Enums in hierarchies with generics produces unnecessary warnings and errors
Product: [Eclipse Project] JDT Reporter: Kory Markevich <vulcannis>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cimlj
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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