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

treats qualified access like access via simple name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.1.2, 1.1.3
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • CPU:
      x86, sparc
    • OS:
      solaris_2.5, windows_95

      Description



      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"
          }
      }
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: