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

Scope.allocateArray needs to be more friendly to null or zero-length array

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • repo-panama
    • core-libs
    • None

      Scope.allocateArray allows to convert a Java array into a native array, it is possible to have an empty Java array. It would be a burden to developer to make sure the array is not empty for every usage.

      When native call use array, it's typically a pointer and a size. An empty Array usually means pass a null pointer(or any pointer as it's likely be ignored) and size 0.

      It would be nice to have an empty Array with length() returns 0 and elementPoitner() returns Poitner.nullPointer().

            henryjen Henry Jen
            henryjen Henry Jen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: