This is the mail archive of the
java-prs@sources.redhat.com
mailing list for the Java project.
gcj/290: can't able access private fields in inner class
- To: java-gnats at sourceware dot cygnus dot com
- Subject: gcj/290: can't able access private fields in inner class
- From: osk at hem dot passagen dot se
- Date: 20 Jul 2000 15:55:14 -0000
- Reply-To: osk at hem dot passagen dot se
- Resent-Cc: java-prs at sourceware dot cygnus dot com, green at cygnus dot com
- Resent-Reply-To: java-gnats@sourceware.cygnus.com, osk@hem.passagen.se
>Number: 290
>Category: gcj
>Synopsis: can't able access private fields in inner class
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jul 20 09:00:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Oskar Liljeblad
>Release: unknown-1.0
>Organization:
>Environment:
egcs 2000-07-17 with various patches from here
>Description:
Compiling this code
class Outer {
public class Inner {
private int field;
}
void someMethod() {
Inner s = new Inner();
s.field = 5;
}
}
with gcj -C gives
test.java: In class `Outer':
test.java: In method `someMethod()':
test.java:7: Can't access private field `Outer$Inner.field' from `Outer'.
s.field = 5;
^
1 error
while jikes/javac compiles it just fine. Note that private
fields in static inner classes should also be accessible
from the outer class.
Oskar Liljeblad (osk@hem.passagen.se)
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: