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

5.4.3.2: Clarify field resolution sequencing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 23
    • specification
    • vm

      A couple of somewhat confusing things in JVMS 5.4.3.2:

      - Field resolution is said to search for the referenced field "in C and its superclasses", ignoring that Step 2 searches its superinterfaces.

      - The order of interfaces to search is not clearly specified (compare the handling of order for method resolution, but in that case *which* method is resolved is not important, due to later selection behaviors). Presumably it's a left-to-right depth-first search?

      It's also a bit surprising that interfaces take priority over superclasses. Not sure if there's a strong motivation for that, or just (at this point) compatibility.

            dlsmith Dan Smith
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: