Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 92298 invoked from network); 9 Nov 2009 07:35:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Nov 2009 07:35:55 -0000 Received: (qmail 34823 invoked by uid 500); 9 Nov 2009 07:35:55 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 34708 invoked by uid 500); 9 Nov 2009 07:35:54 -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 34697 invoked by uid 99); 9 Nov 2009 07:35:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Nov 2009 07:35:54 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Nov 2009 07:35:52 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 83F74234C045 for ; Sun, 8 Nov 2009 23:35:32 -0800 (PST) Message-ID: <996948145.1257752132525.JavaMail.jira@brutus> Date: Mon, 9 Nov 2009 07:35:32 +0000 (UTC) From: "Didier Earith (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (VFS-279) ClassCastException in LocalFileSystem when using OnCall caching In-Reply-To: <1442816282.1250674814877.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/VFS-279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774882#action_12774882 ] Didier Earith commented on VFS-279: ----------------------------------- I don't have any simple unit tests to illustrate the behavior. Just see that fileObject can be an instance of DecoratedFileObject which doesn't inherited from AbstractFileObject. As LocalFile object inherits from AbstractFileObject, if the object file is an DecoratedFileObject , you'll get a class cast exception. See also for example doRename function in the LocalFile class. Or you can search for getAbstractFileObject function, you will see that : "LocalFile localFile = (LocalFile) fileObject;" is never used, but "LocalFile localFile = (LocalFile) FileObjectUtils.getAbstractFileObject(fileObject);" is always used. And this lacks in the doReplicateFile function. > ClassCastException in LocalFileSystem when using OnCall caching > --------------------------------------------------------------- > > Key: VFS-279 > URL: https://issues.apache.org/jira/browse/VFS-279 > Project: Commons VFS > Issue Type: Bug > Affects Versions: 1.0, 1.1, 2.0 > Reporter: Didier Earith > Fix For: 1.0, 1.1, 2.0 > > Attachments: LocalFileSystem.java > > > When using OnCall caching in the file system, there is a ClassCastException in the LocalFileSystem#doReplicateFile function. > To fix the issue, I replaced : > final LocalFile localFile = (LocalFile) fileObject; > by > final LocalFile localFile = (LocalFile) FileObjectUtils.getAbstractFileObject(fileObject); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.