[
https://issues.apache.org/jira/browse/VFS-258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Marek Zawirski updated VFS-258:
-------------------------------
Fix Version/s: 2.0
Fix version: 2.0
> 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.0
>
> 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.
-
You can reply to this email to add a comment to the issue online.