Bug 81729

Summary: [1.5][enum] compiler error if enum implements interface methods in sub classes
Product: [Eclipse Project] JDT Reporter: Peter Schneider-Kamp <psk>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: psk
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
First file of testcase.
none
This is the interface for the testcase.
none
This is the enum for the test case. none

Description Peter Schneider-Kamp CLA 2004-12-21 08:47:28 EST
The compiler complains about unimplemented methods inherited from an interface
which are indeed implemented in the enums sub classes.

The following enum class and interface demonstrate the bug which occurred in a
larger context which would not be appropriate for presentation here.

--- A.java ---
public enum A implements B {
    C {public void f() {}}
}

--- B.java ---
public interface B {
    public void f();
}

The above files compile cleanly on Sun's JDK 1.5.0-b64 on at least the AMD64
platform.

Using Eclipse 3.1M4 (build 200212162000) the following compiler error is
reported in the Problems window:

The type A must implement the inherited abstract method B.f()

A simple workaround is to add the redundant line ";public abstract void f();"
after the declaration of "C".
Comment 1 Peter Schneider-Kamp CLA 2004-12-21 08:49:09 EST
Created attachment 16795 [details]
First file of testcase.

This is the source code for the enum class.
Comment 2 Peter Schneider-Kamp CLA 2004-12-21 08:49:53 EST
Created attachment 16796 [details]
This is the interface for the testcase.
Comment 3 Peter Schneider-Kamp CLA 2004-12-21 08:50:57 EST
Created attachment 16797 [details]
This is the enum for the test case.
Comment 4 Philipe Mulet CLA 2005-01-14 09:41:04 EST
Just got fixed in HEAD

*** This bug has been marked as a duplicate of 82590 ***