[Bug java/21313] New: Incorrect visibility of "package" scope methods (compilation problem)
lhofhansl at yahoo dot com
gcc-bugzilla@gcc.gnu.org
Sun May 1 07:10:00 GMT 2005
Linux (Fedora Core 3)
Pentium M
GCC 4.0.0
Compiling the following two classes produces error:
p2/B.java:7: error: Method Âp1.A.f(int)Â was defined with return type
ÂbooleanÂin class Âp1.AÂ.
void f( int x ) {}
/// A.java ///
package p1;
public class A
{
boolean f( int x ) { return false; }
}
/// B.java ///
package p2;
import p1.A;
public class B extends A
{
void f( int x ) {}
}
//////////////////
To reproduce place A.java in a directory p1, and B.java in directory p2.
Then compile B.java: gcj -C p2/B.java
A.f(...) should not be visible to class B and hence not cause this compilation
error. Sun's javac compiles these classes without error.
--
Summary: Incorrect visibility of "package" scope methods
(compilation problem)
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lhofhansl at yahoo dot com
CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21313
More information about the Java-prs
mailing list