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

5.5: Clarify that new/getstatic/etc only attempt to initialize

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 9
    • Component/s: specification
    • Labels:
    • Subcomponent:
      vm

      Description

      5.5 says "Upon execution of a new instruction, the referenced class is initialized if it has not been initialized already." and similarly for getstatic/putstatic/invokestatic. This can be read as saying that initialization not only starts but always succeeds, which is not accurate. Better to say:

      - Upon execution of a new instruction, the class to be initialized is the class referenced by the instruction.
      - Upon execution of a getstatic, putstatic, or invokestatic instruction, the class or interface to be initialized is the class or interface that declared the resolved field or method.

      In addition, the sentence "These instructions reference a class or interface directly or indirectly through a field reference or a method reference." is inaccurate because 'new' does not employ either kind of reference. The sentence doesn't add much, so should be removed.

        Attachments

          Activity

            People

            • Assignee:
              abuckley Alex Buckley
              Reporter:
              abuckley Alex Buckley
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: