Bug 31450 - Compiler bug with overriding protected abstract methods, where a parent class has package-private abstract method
Summary: Compiler bug with overriding protected abstract methods, where a parent class...
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 XP
: 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-10 09:26 EST by Jon Skeet CLA
Modified: 2003-02-10 09:56 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Skeet CLA 2003-02-10 09:26:27 EST
[M5]

Note, this is *not* the same test case as bug 31398 - note that here the method
is widened to protected access by an intermediate class.

PackageClass.java:
package first;

abstract class PackageClass
{
    abstract void someMethod();
}

BaseClass.java:
package first;

public abstract class BaseClass extends PackageClass
{
    protected abstract void someMethod(); // Widened to protected access
}

Subclass.java:
package second;

import first.BaseClass;

public class Subclass extends BaseClass
{
    public void someMethod()
    {
    }
}

Error messages:
Warning	The method Subclass.someMethod() does not override the inherited method
from PackageClass since it is private to a different package.

Error This class must implement the inherited abstract method
PackageClass.someMethod(), but cannot override it since it is not visible from
Subclass. Either make the type abstract or make the inherited method visible.

The above code is accepted by JDK1.4.1.
Comment 1 Philipe Mulet CLA 2003-02-10 09:29:40 EST
Duplicate of bug 31398

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