Bug 81729 - [1.5][enum] compiler error if enum implements interface methods in sub classes
Summary: [1.5][enum] compiler error if enum implements interface methods in sub classes
Status: RESOLVED DUPLICATE of bug 82590
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-21 08:47 EST by Peter Schneider-Kamp CLA
Modified: 2005-01-14 09:41 EST (History)
1 user (show)

See Also:


Attachments
First file of testcase. (83 bytes, text/plain)
2004-12-21 08:49 EST, Peter Schneider-Kamp CLA
no flags Details
This is the interface for the testcase. (41 bytes, text/plain)
2004-12-21 08:49 EST, Peter Schneider-Kamp CLA
no flags Details
This is the enum for the test case. (55 bytes, text/plain)
2004-12-21 08:50 EST, Peter Schneider-Kamp CLA
no flags Details

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