You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrew Zhang (JIRA)" <ji...@apache.org> on 2006/07/26 08:56:14 UTC

[jira] Created: (HARMONY-979) [classlib][nio]java.nio.channels.FileLock.release() fails to throw ClosedChannelException if the related file channel is closed.

[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

        

[jira] Assigned: (HARMONY-979) [classlib][nio]java.nio.channels.FileLock.release() fails to throw ClosedChannelException if the related file channel is closed.

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-979?page=all ]

Paulex Yang reassigned HARMONY-979:
-----------------------------------

    Assignee: Paulex Yang

> [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
>         Assigned To: Paulex Yang
>         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

        

[jira] Closed: (HARMONY-979) [classlib][nio]java.nio.channels.FileLock.release() fails to throw ClosedChannelException if the related file channel is closed.

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-979?page=all ]

Paulex Yang closed HARMONY-979.
-------------------------------


Verified by Andrew

> [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
>         Assigned To: Paulex Yang
>         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

        

[jira] Commented: (HARMONY-979) [classlib][nio]java.nio.channels.FileLock.release() fails to throw ClosedChannelException if the related file channel is closed.

Posted by "Andrew Zhang (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-979?page=comments#action_12424034 ] 
            
Andrew Zhang commented on HARMONY-979:
--------------------------------------

Hi Paulex,

The fix looks good. Many thanks!

Best regards,
Andrew

> [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
>         Assigned To: Paulex Yang
>         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

        

[jira] Resolved: (HARMONY-979) [classlib][nio]java.nio.channels.FileLock.release() fails to throw ClosedChannelException if the related file channel is closed.

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-979?page=all ]

Paulex Yang resolved HARMONY-979.
---------------------------------

    Resolution: Fixed

Andrew, patch applied at revision r425671, thanks a lot for this enhancement, please verify that the problem is fully fixed as you expected.


> [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
>         Assigned To: Paulex Yang
>         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

        

[jira] Updated: (HARMONY-979) [classlib][nio]java.nio.channels.FileLock.release() fails to throw ClosedChannelException if the related file channel is closed.

Posted by "Andrew Zhang (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-979?page=all ]

Andrew Zhang updated HARMONY-979:
---------------------------------

    Attachment: nio.diff

Hello,

    Would you please try my patch?

Thanks!

Best regards,
Andrew

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