Bug 32083 - overridden methods that change visibility cause compiler error
Summary: overridden methods that change visibility cause compiler error
Status: RESOLVED DUPLICATE of bug 31398
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 RC1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-17 19:08 EST by Eric M. Smith CLA
Modified: 2003-02-18 06:24 EST (History)
0 users

See Also:


Attachments
zip file containing the project and source files for the submitted bug (3.36 KB, application/octet-stream)
2003-02-17 19:12 EST, Eric M. Smith CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric M. Smith CLA 2003-02-17 19:08:50 EST
I have the following 3 classes (a multiple level heirarchy) distributed across 2 packages as follows:

//==========================================//
package com.testHeirarchy.model;
public abstract class A {
    protected String s;
    public A( String s_ ) {
        s = s_;
    }
    /*package*/ abstract void clear();
}

//==========================================//
package com.testHeirarchy.model;
public class B extends A {
    public B( String s_ ) {
        super( s_ );
    }

    public void clear() {
        s = "";
    }
}

//==========================================//
package com.testHeirarchy.showError;
import com.testHeirarchy.model.B;
public class C extends B {
    public C( String s_ ) {
        super( s_ );
    }
}


The entire heirarchy compiles under Sun jdk 1.3.1_06; however under the M5 build of eclipse, class C cannot compile.  The generated error is :

This class must implement the inherited abstract method A.clear(), but cannot override it since it is not visible from C. Either make the type abstract or make the inherited method visible.	
C.java	testHeirarchy/src/com/testHeirarchy/showError	line 14
Comment 1 Eric M. Smith CLA 2003-02-17 19:12:41 EST
Created attachment 3539 [details]
zip file containing the project and source files for the submitted bug

This file is a simple test case that reproduces the bug.
Comment 2 Philipe Mulet CLA 2003-02-18 06:24:24 EST
Assuming you are running Eclipse M5(RC0) build, this regression got addressed 
in subsequent integration build.

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