RFR: JDK-8028726 - (prefs) Check src/solaris/native/java/util/FileSystemPreferences.c for JNI pending exceptions

Alan Bateman Alan.Bateman at oracle.com
Tue Jan 7 09:36:52 UTC 2014


On 06/01/2014 22:29, Dan Xu wrote:
> Hi All,
>
> Please review the simple fix for JNI pending exceptions in 
> FileSystemPreferences.c. Thanks!
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8028726
> Webrev: http://cr.openjdk.java.net/~dxu/8028726/webrev/
The update to FIleSystemPreferences.c looks okay but if I read it 
correctly then lockFile0 can never return NULL without a pending 
exception (meaning that the change to FileSystemPreferences.java could 
mask an underlying bug if it existed).

One passing comment is that this native methods could be completely 
eliminated here by changing FileSystemPreferences to lock the file via a 
FileChannel (use a FileLock as the lock handle). Also the chmod usage 
can be eliminated by mkdirs with Files.createDirectory and specify the 
permission files when creating the directory. I realize this is beyond 
the scope of what you are doing here (but an opportunity none the less).

-Alan



More information about the core-libs-dev mailing list