The documentation for GetStringChars and GetStringUTFChars is unclear

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P3
    • 9
    • Affects Version/s: 6u3
    • Component/s: hotspot
    • generic
    • generic

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: