RFR: JNI: Return the correct error code when a VM is already created

Sylvestre Ledru sylvestre at debian.org
Thu Jul 4 01:44:14 PDT 2013


On 04/07/2013 01:17, Coleen Phillimore wrote:
> On 7/3/2013 7:02 PM, David Holmes wrote:
>> I don't see that anything has changed from what I said 3 years ago:
>>
>>> This is a curious part of the JNI spec as it doesn't actually define
>>> a set of error codes, even though jni.h does contain a few,
>>> including JNI_EEXIST. But at least we aren't constrained by the spec
>>> as CreateJavaVM is allowed to return a "a suitable JNI error code (a
>>> negative number) on failure".
>>>
>>> The question is, is it too late to change this? Any code that checks
>>> for JNI_ERR will now be broken, but code that checks for !JNI_OK will
>>> be fine.
>>
>> There is a compatability risk here. So if this is changed it needs to
>> be documented in the release notes, or any other "JNI changes"
>> document that might exist for 8.
> 
> Ok.   We can do this.
No doubt there is a compatibility risk. However, I guess it is low,
programmers are likely to use such functions with something like:
if (res != JNI_OK)
which will still work with my patch.

Can I help on the release notes ?

Thanks,
Sylvestre


More information about the hotspot-runtime-dev mailing list