This is the mail archive of the java-prs@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcj/290: can't able access private fields in inner class



>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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]