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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8
    • specification
    • vm

      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.

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

              Created:
              Updated:
              Resolved: