public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: java/2361: Cannot acces protected field of superclass in a different package
@ 2001-03-23  7:26 Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2001-03-23  7:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Mark Wielaard <mark@klomp.org>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: java/2361: Cannot acces protected field of superclass in a different package
Date: Fri, 23 Mar 2001 16:18:00 +0100

 Note that I found this bug while trying to set up mauve.
 Don't people run mauve with gcj?


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

* java/2361: Cannot acces protected field of superclass in a different package
@ 2001-03-23  7:06 mark
  0 siblings, 0 replies; 2+ messages in thread
From: mark @ 2001-03-23  7:06 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2361
>Category:       java
>Synopsis:       Cannot acces protected field of superclass in a different package
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 23 07:06:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     mark@klomp.org
>Release:        gcc version 3.0 20010323 (powerpc) and gcc version 3.1 20010323 (i586)
>Organization:
>Environment:

>Description:
Accessing a protected field from a superclass in a different package fails when you try to access it through a different instance. For example try the following:

package pkg;

public class C {
protected int p = 16;
}

class Test extends pkg.C {
    void test() {
        Test test = new Test();
        int i = p; // this succeeds
        int j = test.p; // this should also be possible
    }
}
package pkg;

public class C {
    protected int p = 16;
}

$ gcj -C Test.java pkg/C.java 
Test.java: In class `Test':
Test.java: In method `Test.test()':
Test.java:5: Can't access protected field `Test.p' from `Test'.
           int j = test.p;
                       ^
1 error

Compiling first with jikes to class files and then compiling the class files to o files with gcj does work.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2001-03-23  7:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-23  7:26 java/2361: Cannot acces protected field of superclass in a different package Mark Wielaard
  -- strict thread matches above, loose matches on Subject: below --
2001-03-23  7:06 mark

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