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

treats qualified access like access via simple name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.2, 1.1.3
    • tools
    • None
    • x86, sparc
    • solaris_2.5, windows_95



      Name: tb29552 Date: 08/12/97


      In the following code, the qualified name C.y is illegal,
      because C names a type, and y names a non-static member of
      that type. Javac accepts this code inside an instance
      method of C, which implies it is using the presence of
      "this" as a reason for allowing the access.

      class C {
          int y = 5;

          void f () {
              System.out.println(C.y); // looks like javac is treating as "this.y"
          }
      }
      ======================================================================

            dstoutamsunw David Stoutamire (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: