RFR: JNI: Return the correct error code when a VM is already created
David Holmes
david.holmes at oracle.com
Wed Jul 3 16:02:21 PDT 2013
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.
David
-----
On 2/07/2013 7:55 PM, Sylvestre Ledru wrote:
> Hello,
>
> I initially proposed this attached patch 3 years ago [1]
> I was wondering if this patch could be applied against the version 8. I
> tested it against the JDK 7 and 8 (the patch applies without any problem
> to both forest).
>
> This would save a lot of time for people who are getting this bug.
> Without it, it is hard to find out what is wrong in the JNI code.
>
> Thanks,
> Sylvestre
> [1]
> http://mail.openjdk.java.net/pipermail/hotspot-dev/2010-September/003340.html
> PS: please C/C me
>
More information about the hotspot-runtime-dev
mailing list