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

JNI spec: clarify NewWeakGlobalRef handling of weak global references

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • 22
    • hotspot
    • b13
    • 13
    • b11

      The spec for NewWeakGlobalRef initially states:

      Returns NULL if obj refers to null, or if obj was a weak global reference, or if the VM runs out of memory.

      However, the actual "returns" section states:

      May return NULL if:

          obj refers to null
          the system has run out of memory
          obj was a weak global reference and has already been garbage collected

      The part "and has already been garbage collected" is missing from the initial text and may cause confusion.

      The "returns" section was updated by JDK-8188066 but the expanded information was not also added to the main text.

            dholmes David Holmes
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: