public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: java/1262: Method with default access can be overridden in another package
@ 2003-05-12  3:06 Dara Hazeghi
  0 siblings, 0 replies; 2+ messages in thread
From: Dara Hazeghi @ 2003-05-12  3:06 UTC (permalink / raw)
  To: apbianco; +Cc: gcc-prs

The following reply was made to PR java/1262; it has been noted by GNATS.

From: Dara Hazeghi <dhazeghi@yahoo.com>
To: apbianco@gcc.gnu.org, gcc-gnats@gcc.gnu.org, bryce@albatross.co.nz
Cc:  
Subject: Re: java/1262: Method with default access can be overridden in another package
Date: Sun, 11 May 2003 20:02:32 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=1262
 
 Hello,
 
 this PR was filed against (then current) gcc 3.0 snapshot. Would it be  
 possible to determine if this problem is still present in current 3.3  
 or mainline, and update the report accordingly? Thanks,
 
 Dara
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* java/1262: Method with default access can be overridden in another package
@ 2000-12-20 12:23 bryce
  0 siblings, 0 replies; 2+ messages in thread
From: bryce @ 2000-12-20 12:23 UTC (permalink / raw)
  To: java-gnats

>Number:         1262
>Category:       java
>Synopsis:       Method with default access can be overridden in another package
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:18:27 PST 2000
>Closed-Date:    
>Last-Modified:  
>Originator:     Bryce McKinlay
>Release:        unknown-1.0
>Organization:
>Environment:
gcc version 2.96 20000525 (experimental)
>Description:
It is legal in Java for class to declare a method with the
same name as a default (package-private) method in a 
foreign-package superclass.

However, because it is invisible to the sub-class, the
method should NOT override the superclasses method 
declaration.

>How-To-Repeat:
Compile the following code:

// file: pkg1/A.java
package pkg1;
public class A 
{
  void foo () 
  {
    System.out.println ("A.foo()");
  }
  
  public static void main(String[] args) {
    A x = new pkg2.B();
    x.foo();
  }
}

// file: pkg2/B.java
package pkg2;
public class B extends pkg1.A 
{
  protected void foo ()
  {
    System.out.println("B.foo()"); 
  }
}

The correct output (as tested on IBM JDK 1.1.8 and Sun 1.2.2)
should read:

$ java pkg1.A
A.foo()

The gcj-compiled output is:

$ ./pkg
B.foo()
>Fix:

>Release-Note:
>Audit-Trail:

Formerly PR gcj/244

>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-12  3:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-12  3:06 java/1262: Method with default access can be overridden in another package Dara Hazeghi
  -- strict thread matches above, loose matches on Subject: below --
2000-12-20 12:23 bryce

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).