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

JNI_GetCreatedJavaVMs spec not clear on whether nVMs can be NULL, also behavior when no VM running

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      The specification for JNI_GetCreatedJavaVMs does not make it clear whether the nVMs parameter can be passed as NULL. HotSpot allows it to be NULL, apparently J9 does not. As HotSpot (and possibly other VMs) allow the parameter be NULL then it would be compatibility issue to disallow it now (could break eixsting code). Although the spec should make it clear that NULL is allowed, it should also include a warning that passing NULL should be discouraged as otherwise the user of the function has no way to know if JavaVM* is valid or not.

      In addition JNI_GetCreatedJavaVMs is not completely clear how it should behave when there isn't a VM running. Developers may wonder if it will return JNI_ERR or some other error, or whether it will return JNI_OK with *nVMs set to 0.

      More information can be found in this thread on OpenJDK:

      http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-May/010133.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                alanb Alan Bateman
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: