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-902) [classlib][nio] compatibility: java.nio.channels.FileChannel.read(ByteBuffer[], int, int) throws different exception from RI.
Date Tue, 18 Jul 2006 02:16:13 GMT
[classlib][nio] compatibility: java.nio.channels.FileChannel.read(ByteBuffer[], int, int) throws
different exception from RI.
-----------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-902
                 URL: http://issues.apache.org/jira/browse/HARMONY-902
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Andrew Zhang
            Priority: Minor


java.nio.channels.FileChannel.read(ByteBuffer, int, int) throws different exception from RI.
Following test reproduces the bug:

    public void test_read_ClosedChannelException() throws IOException {
        File testFile = File.createTempFile("test", "tmp");
        testFile.deleteOnExit();
        FileChannel channel = new RandomAccessFile(testFile,"rw").getChannel();
        ByteBuffer b[] = new ByteBuffer[2];
        b[0] = null;
        channel.close();
        try {
            channel.read(b, 0, 1);
            fail("should throw ClosedChannelException");
        } catch (ClosedChannelException e) {
            // expected
        }
    }

The test passes against RI while fails against Harmony.

I'll upload a patch to fix this problem soon. Thanks!

Best regards,
Andrew


-- 
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