public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "lhofhansl at yahoo dot com" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug java/21313] New: Incorrect visibility of "package" scope methods (compilation problem)
Date: Sun, 01 May 2005 07:10:00 -0000	[thread overview]
Message-ID: <20050501071023.21313.lhofhansl@yahoo.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1203 bytes --]

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


             reply	other threads:[~2005-05-01  7:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-01  7:10 lhofhansl at yahoo dot com [this message]
2005-05-01 13:50 ` [Bug java/21313] " pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050501071023.21313.lhofhansl@yahoo.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).