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

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

    Fix Version/s:     (was: 2.0)
                   2.1
    
> 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

        

Reply via email to