Bug 21313 - Incorrect visibility of "package" scope methods (compilation problem)
Incorrect visibility of "package" scope methods (compilation problem)
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: java
4.0.0
: P2 normal
: 4.3.0
Assigned To: Not yet assigned to anyone
: rejects-valid
Depends on: 28067
Blocks: 13607
  Show dependency treegraph
 
Reported: 2005-05-01 07:10 UTC by Lars Hofhansl
Modified: 2007-01-09 20:47 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-05-01 13:50:08


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Hofhansl 2005-05-01 07:10:26 UTC
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.
Comment 1 Andrew Pinski 2005-05-01 13:50:08 UTC
Confirmed.
Comment 2 Tom Tromey 2007-01-09 20:47:34 UTC
All gcj front end bugs have been fixed by the gcj-eclipse branch merge.
I'm mass-closing the affected PRs.
If you believe one of these was closed in error, please reopen it
with a note explaining why.
Thanks.