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

The documentation for GetStringChars and GetStringUTFChars is unclear

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • 9
    • 6u3
    • 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: