Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8D8919133 for ; Wed, 16 May 2012 15:03:24 +0000 (UTC) Received: (qmail 83163 invoked by uid 500); 16 May 2012 15:03:24 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 83081 invoked by uid 500); 16 May 2012 15:03:24 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 83073 invoked by uid 99); 16 May 2012 15:03:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2012 15:03:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2012 15:03:22 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id CDCC77ACA for ; Wed, 16 May 2012 15:03:02 +0000 (UTC) Date: Wed, 16 May 2012 15:03:02 +0000 (UTC) From: "Gary D. Gregory (JIRA)" To: issues@commons.apache.org Message-ID: <497487305.4227.1337180582844.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (VFS-258) [SFTP][RAM] Unsafe casting to AbstractFileObject subclasses in doRename(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ 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