Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
Novice
Description
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
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