commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary D. Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (VFS-258) [SFTP][RAM] Unsafe casting to AbstractFileObject subclasses in doRename().
Date Wed, 16 May 2012 15:03:02 GMT

     [ https://issues.apache.org/jira/browse/VFS-258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gary D. Gregory updated VFS-258:
--------------------------------

    Summary: [SFTP][RAM] Unsafe casting to AbstractFileObject subclasses in doRename().  (was:
Unsafe casting to AbstractFileObject subclasses in doRename())

Update title to show this is a bug in [SFTP] and [RAM].
                
> [SFTP][RAM] Unsafe casting to AbstractFileObject subclasses in doRename().
> --------------------------------------------------------------------------
>
>                 Key: VFS-258
>                 URL: https://issues.apache.org/jira/browse/VFS-258
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Marek Zawirski
>             Fix For: 2.1
>
>         Attachments: doRename_use_AbstractFileObject.patch
>
>
> AbstractFileObject#doRename() method is called from AbstractFileObject#moveTo() when
file can be moved within the same file system. As it concerns file that is subclass AbstractFileObject,
target file is also assumed to be AbstractFileObject type. However, this target file can be
decorated. Undressing with FileObjectUtils.getAbstractFileObject() was not performed in every
places that it should be. Some subclasses do correct stripping of decorator in doRename()
implementations (e.g. FtpFileObject), some of them not (e.g. RamFileObject) - which may cause
ClassCastExceptions.
> Patch proposal: pass undressed AbstractFileObject to doRename() instead of possibly decorated
FileObject.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message