Bug 32083

Summary: overridden methods that change visibility cause compiler error
Product: [Eclipse Project] JDT Reporter: Eric M. Smith <esmith>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 RC1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
zip file containing the project and source files for the submitted bug none

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 ***