harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-979) [classlib][nio]java.nio.channels.FileLock.release() fails to throw ClosedChannelException if the related file channel is closed.
Date Wed, 26 Jul 2006 06:56:14 GMT
[classlib][nio]java.nio.channels.FileLock.release() fails to throw ClosedChannelException if
the related file channel is closed.
--------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-979
                 URL: http://issues.apache.org/jira/browse/HARMONY-979
             Project: Harmony
          Issue Type: Bug
            Reporter: Andrew Zhang
         Attachments: nio.diff

Hi,
    java.nio.channels.FileLock.release() does not throw ClosedChannelException
if the related file channel has been closed on Harmony while RI does.
    test:
public void test_release() throws Exception {
        File file = File.createTempFile("test", "tmp");
        file.deleteOnExit();
        FileOutputStream fout = new FileOutputStream(file);
        FileChannel fileChannel = fout.getChannel();
        FileLock fileLock = fileChannel.lock();
        fileChannel.close();
        try {
            fileLock.release();
            fail("should throw ClosedChannelException");
        } catch (ClosedChannelException e) {
            // expected
        }
      }
The test passes against RI while fails against Harmony.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message