public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: bryce@albatross.co.nz
To: java-gnats@sourceware.cygnus.com
Subject: java/1267: Innerclass cannot access protected method declared in foreign-package superclass of parent
Date: Wed, 20 Dec 2000 12:23:00 -0000	[thread overview]
Message-ID: <20000529044956.7421.qmail@sourceware.cygnus.com> (raw)

>Number:         1267
>Category:       java
>Synopsis:       Innerclass cannot access protected method declared in foreign-package superclass of parent
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:18:30 PST 2000
>Closed-Date:    Thu Jul 20 17:05:56 PDT 2000
>Last-Modified:  Thu Jul 20 17:16:01 PDT 2000
>Originator:     Bryce McKinlay
>Release:        gcc version 2.96 20000525 (experimental) w/ PR177 fix
>Organization:
>Environment:

>Description:
An inner class should have the same access as its enclosing
class with regard to accessing methods and fields in other
top level classes. 

Protected methods in a superclass of the enclosing class
should be accessible from the inner class, even if the
superclass is in a foreign package. But gcj gets the 
following error:

$ gcj AnonTest.java pkg1/Base.java -o at --main=AnonTest
AnonTest.java: In class `AnonTest$Inner':
AnonTest.java: In method `test()':
AnonTest.java:9: Can't access protected method `void pkg1.Base.a()' from `AnonTest$Inner'.
      a();
      ^
1 error
>How-To-Repeat:
Try to compile this test case:

// AnonTest.java
import pkg1.*;

public class AnonTest extends Base
{
  class Inner
  {
    void test()
    {
      a();
    }
  }
}

// pkg1/Base.java
package pkg1;

public class Base
{
  protected void a() {}
}
>Fix:

>Release-Note:

>Audit-Trail:

Formerly PR gcj/249

State-Changed-From-To: open->feedback
State-Changed-By: apbianco
State-Changed-When: Thu Jul 13 20:19:09 2000
State-Changed-Why:
    Thanks for the report. I attached a patch.

From: apbianco@cygnus.com
To: apbianco@cygnus.com, bryce@albatross.co.nz,
  java-gnats@sourceware.cygnus.com
Cc:  
Subject: Re: gcj/249
Date: 14 Jul 2000 03:19:10 -0000

 Synopsis: Innerclass cannot access protected method declared in foreign-package superclass of parent
 
 State-Changed-From-To: open->feedback
 State-Changed-By: apbianco
 State-Changed-When: Thu Jul 13 20:19:09 2000
 State-Changed-Why:
     Thanks for the report. I attached a patch.
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=249&database=java
State-Changed-From-To: feedback->closed
State-Changed-By: apbianco
State-Changed-When: Thu Jul 20 17:05:56 2000
State-Changed-Why:
    I checked in a jumbo patch that fixes gcj/249 (among other PRs:)
    
     http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00801.html

From: apbianco@cygnus.com
To: apbianco@cygnus.com, bryce@albatross.co.nz,
  java-gnats@sourceware.cygnus.com
Cc:  
Subject: Re: gcj/249
Date: 21 Jul 2000 00:05:56 -0000

 Synopsis: Innerclass cannot access protected method declared in foreign-package superclass of parent
 
 State-Changed-From-To: feedback->closed
 State-Changed-By: apbianco
 State-Changed-When: Thu Jul 20 17:05:56 2000
 State-Changed-Why:
     I checked in a jumbo patch that fixes gcj/249 (among other PRs:)
     
      http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00801.html
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=249&database=java
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="patch"

MjAwMC0wNy0xMyAgQWxleGFuZHJlIFBldGl0LUJpYW5jbyAgPGFwYmlhbmNvQGN5Z251cy5jb20+
CgoJKiBwYXJzZS55IChub3RfYWNjZXNzaWJsZV9wKTogQWNjZXNzIGdyYW50ZWQgdG8gaW5uZXJj
bGFzc2VzCgkoaW5kaXJlY3RseSkgZXh0ZW5kaW5nIHRoZSByZWZlcmVuY2UgdHlwZS4gRml4ZXMg
Z2NqLzI0OS4KCkluZGV4OiBwYXJzZS55Cj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KZGlmZiAt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ICBy
ZXR1cm4gMTsK



                 reply	other threads:[~2000-12-20 12:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20000529044956.7421.qmail@sourceware.cygnus.com \
    --to=bryce@albatross.co.nz \
    --cc=java-gnats@sourceware.cygnus.com \
    /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).