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

The documentation for GetStringChars and GetStringUTFChars is unclear

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 6u3
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0_03"
      Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
      Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
       Windows Vista [Version 6.0.6000]

      A DESCRIPTION OF THE PROBLEM :
      The documentation for GetStringChars and GetStringUTFChars
      is unclear on whether you can count on a null char being appended automatically on the result.

      docs/technotes/guides/jni/spec/functions.html#wp17265

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      read the bundled docs. Read Sheng Liang's The Java Native Inferface. It has the same omission.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      It should say explicitly if the string returned can be counted on to have a terminating null.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Presume null is sometimes returned and write voluminous code to deal with either possibility.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dsimms David Simms
                Reporter:
                ndcosta Nelson Dcosta (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: