You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Miroslav Pokorny (JIRA)" <ji...@apache.org> on 2011/07/22 03:31:57 UTC

[jira] [Created] (VFS-358) RamFileRandomAccessContent.close() does call RamFileObject.close().

RamFileRandomAccessContent.close() does call RamFileObject.close().
-------------------------------------------------------------------

                 Key: VFS-358
                 URL: https://issues.apache.org/jira/browse/VFS-358
             Project: Commons VFS
          Issue Type: Bug
    Affects Versions: 1.0
            Reporter: Miroslav Pokorny


The problem manifests itself if one uses RandomAccessContent from a FileObject which is from ram://. Closing any stream from the RAC does not cleanup some counters which means future calls to FileObject.isContentOpen() return true which is wrong because the RAC.close().

The fix to RamFileRandomAccessContent.close() is a simple one liner.

    /*
     * (non-Javadoc)
     * 
     * @see org.apache.commons.vfs.RandomAccessContent#close()
     */
    @Override
    public void close() throws IOException {
        // do not try and call rafis.close() which does nothing but call this method.
        this.file.close();
    }



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (VFS-358) RamFileRandomAccessContent.close() does *NOT* call RamFileObject.close().

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114161#comment-13114161 ] 

Ralph Goers commented on VFS-358:
---------------------------------

>From what I can see none of the RandomAccessContent implementations close their associated FileObject so I'm not sure why that should be done here. It seems to me the RandomAccessContent needs to be invalidated during close and any further calls should throw an exception.

> RamFileRandomAccessContent.close() does *NOT* call RamFileObject.close().
> -------------------------------------------------------------------------
>
>                 Key: VFS-358
>                 URL: https://issues.apache.org/jira/browse/VFS-358
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 1.0
>            Reporter: Miroslav Pokorny
>
> The problem manifests itself if one uses RandomAccessContent from a FileObject which is from ram://. Closing any stream from the RAC does not cleanup some counters which means future calls to FileObject.isContentOpen() return true which is wrong because the RAC.close().
> The fix to RamFileRandomAccessContent.close() is a simple one liner.
>     /*
>      * (non-Javadoc)
>      * 
>      * @see org.apache.commons.vfs.RandomAccessContent#close()
>      */
>     @Override
>     public void close() throws IOException {
>         // do not try and call rafis.close() which does nothing but call this method.
>         this.file.close();
>     }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (VFS-358) RamFileRandomAccessContent.close() does *NOT* call RamFileObject.close().

Posted by "Miroslav Pokorny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Miroslav Pokorny updated VFS-358:
---------------------------------

    Summary: RamFileRandomAccessContent.close() does *NOT* call RamFileObject.close().  (was: RamFileRandomAccessContent.close() does call RamFileObject.close().)

> RamFileRandomAccessContent.close() does *NOT* call RamFileObject.close().
> -------------------------------------------------------------------------
>
>                 Key: VFS-358
>                 URL: https://issues.apache.org/jira/browse/VFS-358
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 1.0
>            Reporter: Miroslav Pokorny
>
> The problem manifests itself if one uses RandomAccessContent from a FileObject which is from ram://. Closing any stream from the RAC does not cleanup some counters which means future calls to FileObject.isContentOpen() return true which is wrong because the RAC.close().
> The fix to RamFileRandomAccessContent.close() is a simple one liner.
>     /*
>      * (non-Javadoc)
>      * 
>      * @see org.apache.commons.vfs.RandomAccessContent#close()
>      */
>     @Override
>     public void close() throws IOException {
>         // do not try and call rafis.close() which does nothing but call this method.
>         this.file.close();
>     }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira