RFR: JDK-8028726 - (prefs) Check src/solaris/native/java/util/FileSystemPreferences.c for JNI pending exceptions
Dan Xu
dan.xu at oracle.com
Wed Jan 8 17:56:40 UTC 2014
Thank you, Alan. I will add this change into my fix and push it today.
Thanks!
-Dan
On 01/08/2014 01:24 AM, Alan Bateman wrote:
> On 08/01/2014 00:50, Dan Xu wrote:
>> Hi All,
>>
>> Thanks for your good review. I have dropped the change in
>> FileSystemPreferences.java , and created the new webrev which only
>> changes FileSystemPreferences.c. Please help review it. Thanks!
>>
>> Webrev: http://cr.openjdk.java.net/~dxu/8028726/webrev.01/
>>
>> When changing FileSystemPreferences.c, I noticed the code like
>> "JNU_GetStringPlatformChars(env, java_fname, JNI_FALSE)". Because
>> JNI_FALSE is passed into this function, I am wondering why our code
>> still release string by calling JNU_ReleaseStringPlatformChars(env,
>> java_fname, fname). Thanks!
> This is the isCopy parameter to allow the function return whether it
> has returned a copy or not. So the JNU_ReleaseStringPlatformChars is
> needed. However the JNI_FALSE isn't right, it does happens to work
> because JNI_FALSE is defined as 0, same as NULL. Do you mind changing
> these to NULL as part of the change so that it's a bit more obvious?
> (no need to publish a new webrev if there are no other changes).
>
> Otherwise looks fine to me.
>
> -Alan.
More information about the core-libs-dev
mailing list