Hi folks,
Harmony doesn't support to call FileLock.release by reflection. Following
test case shows the problem. The failure reason is that our implementation
class FileLockImpl is not public. A jira issue (
https://issues.apache.org/jira/browse/HARMONY-3743) is filed. Shall we fix
it for compatibility reason? Thanks!
public void testRelease() throws Exception {
File f = File.createTempFile("nio", "tmp");
RandomAccessFile raf = new RandomAccessFile(f, "rw");
FileChannel fc = raf.getChannel();
FileLock lock = fc.lock();
Method releaseMethod = lock.getClass().getMethod("release",
(Class[]) null);
releaseMethod.invoke(lock, (Object[]) null);
}
--
Best regards,
Andrew Zhang