gcj/234: methods inheirited from base class are not resolved to interface
fegray@uiuc.edu
fegray@uiuc.edu
Sun May 21 20:40:00 GMT 2000
>Number: 234
>Category: gcj
>Synopsis: methods inheirited from base class are not resolved to interface
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun May 21 20:40:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Fred Gray (fegray@uiuc.edu)
>Release: current CVS
>Organization:
>Environment:
Debian GNU/Linux potato x86
>Description:
(The example below probably states this more clearly.)
If a class:
- inheirits methods from its superclass, and
- implements an interface which its superclass does not implement, and
- the inheirited methods ought to be part of the interface because their names and signatures match those declared in the interface,
the inheirited methods are nevertheless not matched up to the interface.
>How-To-Repeat:
Copy the following three files into a directory and
attempt to compile with "gcj -c A.java":
// A.java
public class A extends B implements I
{
public static void main(String args[])
{
A x = new A();
x.m();
}
}
// B.java
public class B
{
public void m()
{
}
}
// I.java
public interface I
{
public void m();
}
You will get the following error message:
A.java: In class `A':
A.java: In method `main(java.lang.String[])':
A.java:6: Can't find method `m()' in type `A'. Candidates are:
`m()' in `I'
`m()' in `B'.
x.m();
Compiling the associated .class files works fine.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Java-prs
mailing list