harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject [classlib][nio][compatibility] Harmony doesn't support to call FileLock.release by reflection.
Date Tue, 24 Apr 2007 12:21:17 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message