Summary
Modify JNI_GetPrimitiveArrayCritical()
so that it assumes it is passed a primitive array rather than handing back a pointer to an Object array.
Problem
JNI_GetPrimitiveArrayCritical()
only supports primitive arrays, and returns a "raw" pointer to the primitive array type passed in. For reasons unknown the implementation has always accepted an Object array and returned a raw pointer to it. This should not happen.
Solution
Change the implementation to assume it has a primitive array. This will likely lead to a crash if passed an Object array - which is perfectly fine for JNI (see comments). Passing an incorrect array type will be detected by -Xcheck:jni
.
Specification
There is no specification change. This is a behavioural change to make the implementation match the specification.
- csr of
-
JDK-8269697 JNI_GetPrimitiveArrayCritical() should not accept object array
-
- Resolved
-