Re: Pass a pointer to JNI_GetCreatedJavaVMs() instead of null / review please

2012-05-08 Thread Kumar Srinivasan
Hi Alan, David, Vitaly, Ok I will make these changes and push. Thanks Kumar On 07/05/2012 21:21, Kumar Srinivasan wrote: Hi, Please review http://cr.openjdk.java.net/~ksrini/7166955 I think the check needs to be: if (retval < 0 || nVM != 1) (checking if retval == JNI_OK is okay too but

Re: Pass a pointer to JNI_GetCreatedJavaVMs() instead of null / review please

2012-05-08 Thread Alan Bateman
On 07/05/2012 21:21, Kumar Srinivasan wrote: Hi, Please review http://cr.openjdk.java.net/~ksrini/7166955 I think the check needs to be: if (retval < 0 || nVM != 1) (checking if retval == JNI_OK is okay too but amounts to the same thing). -Alan

Re: Pass a pointer to JNI_GetCreatedJavaVMs() instead of null / review please

2012-05-07 Thread David Holmes
Hi Kumar, On 8/05/2012 6:21 AM, Kumar Srinivasan wrote: Hi, Please review http://cr.openjdk.java.net/~ksrini/7166955 Thanks for jumping on checking the return value. Actually hotspot can never return an error here so it was much less of an issue than I thought. David - Thanks Kumar

Re: Pass a pointer to JNI_GetCreatedJavaVMs() instead of null / review please

2012-05-07 Thread Vitaly Davidovich
I agree it doesn't really matter; using JNI_OK is arguably slightly better as it (1) doesn't assume anything about what non negative value it'll assume and (2) uses the constant defined specifically for this, but I agree it's insignificant in the grand scheme of things. Cheers Sent from my phone

Re: Pass a pointer to JNI_GetCreatedJavaVMs() instead of null / review please

2012-05-07 Thread Kumar Srinivasan
Hi Vitaly, The JNI Spec says the following: "Returns |JNI_OK| on success; returns a suitable JNI error code (a negative number) on failure." It doesn't really matter, if others feel strongly about it, I will change it. Kumar Hi Kumar, Based on the discussion, should it check for a (re

Re: Pass a pointer to JNI_GetCreatedJavaVMs() instead of null / review please

2012-05-07 Thread Vitaly Davidovich
Hi Kumar, Based on the discussion, should it check for a (retval != JNI_OK || vm == null) instead of (retval < 0 || vm == null)? Regards, Vitaly Sent from my phone On May 7, 2012 4:23 PM, "Kumar Srinivasan" wrote: > Hi, > > Please review > > http://cr.openjdk.java.net/~**ksrini/7166955

Re: Pass a pointer to JNI_GetCreatedJavaVMs() instead of null / review please

2012-05-07 Thread Kumar Srinivasan
Hi, Please review http://cr.openjdk.java.net/~ksrini/7166955 Thanks Kumar On 07/05/2012 16:45, Kumar Srinivasan wrote: Hi David, Deven, Alan, The spec doesn't say anything but the implementation does check for NULL. I think this is a spec issue rather than a code issue (and I think hotspo