Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4249096

JLS 6.6.2 not fully implemented in new compiler

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.3.0
    • 1.1, 1.3.0
    • tools
    • kestrel
    • generic, x86
    • generic, windows_95

      Date: Thu, 27 May 1999 11:02:28 +0100
      From: Roly Perera <###@###.###>
      To: William Maddox <###@###.###>
      Subject: RE: JSL 6.6.2 not implemented

      The problem only occurs accessing a static protected field via a type qualifier. According to JLS 6.6.2, both uses of
      "i" in class B are illegal, but javac-ea only rejects the second use (access of a static protected field via an
      expression qualifier).

      After reading some of the javac bug reports relating to this it appears there has been some discussion about relaxing
      the 6.6.2 rules specifically for static fields, but either way there appears to be an inconsistency here.

      - Roly


      package othello;

      public class F
      {
          protected static int i;
      }

      package desdemona;

      import othello.F;

      class B extends F
      {
          {
              F.i = 5; // OK
              new F().i = 5; // complains
          }
      }

            wmaddoxsunw William Maddox (Inactive)
            wmaddoxsunw William Maddox (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: