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.
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.
- duplicates
-
JDK-8037115 Clarify exceptions thrown in JNI
-
- Closed
-
-
JDK-8038005 Improve JNI spec for string methods
-
- Closed
-
-
JDK-8079466 JNI Specification Update and Clean-up (JDK 8)
-
- Resolved
-
- relates to
-
JDK-4616318 Spec for JNI's GetStringChars() is incomplete
-
- Closed
-
-
JDK-8038005 Improve JNI spec for string methods
-
- Closed
-