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 3CDD411275 for ; Sun, 18 May 2014 06:15:36 +0000 (UTC) Received: (qmail 14539 invoked by uid 500); 18 May 2014 05:50:32 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 4060 invoked by uid 500); 18 May 2014 05:25:31 -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 2969 invoked by uid 99); 18 May 2014 05:22:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 May 2014 05:22:15 +0000 Date: Sun, 18 May 2014 05:22:15 +0000 (UTC) From: "Roger Whitcomb (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (VFS-523) HdfsFileObject equals method returns true for the same path on different hosts 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-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14001000#comment-14001000 ] Roger Whitcomb edited comment on VFS-523 at 5/18/14 5:21 AM: ------------------------------------------------------------- Hi Bernd, The code I'm using is in the Apache Pivot project in the VFSFileBrowser and related classes. The failure I noticed, specifically, was that two HdfsFileObjects had the same path on different file systems, and they had the "equals" method return true. I believe the code is consistently calling "equals" for these types of comparisons, but I don't know if all the tests are !equals or just equals. I am a little reluctant to say that using just Object.equals would be fine, because (for instance) I would expect that an existing object pointing to a certain directory on a given filesystem should be "equal" to a newly created object pointing to that same directory on the same filesystem, which Object.equals would not return true for (so, I expect this to work similarly to String.equals where the method returns true if the content is the same, not merely when the objects are exactly the same object). So, I will test your latest patch as soon as I return to the office on Tuesday (unfortunately I am not in a position to try it until then). Thank you for the investigation on this. ~Roger was (Author: rwhitcomb): Hi Bernd, The code I'm using is in the Apache Pivot project in the VFSFileBrowser and related classes. The failure I noticed, specifically, was that two HdfsFileObjects had the same path on different file systems, and they had the "equals" method return true. I believe the code is consistently calling "equals" for these types of comparisons, but I don't know if all the tests are !equals or just equals. I would think that defaulting to the generic Object.equals would probably be fine. So, I will test your latest patch as soon as I return to the office on Tuesday (unfortunately I am not in a position to try it until then). Thank you for the investigation on this. ~Roger > HdfsFileObject equals method returns true for the same path on different hosts > ------------------------------------------------------------------------------ > > Key: VFS-523 > URL: https://issues.apache.org/jira/browse/VFS-523 > Project: Commons VFS > Issue Type: Bug > Affects Versions: 2.1 > Environment: Windows 7 > Reporter: Roger Whitcomb > Priority: Minor > Labels: hdfs > Fix For: 2.1 > > Attachments: hdfsequal.diff, unify-hdfs-equals.patch > > > If I construct two HdfsFileObject referring to the same path (for instance, "/") but on different hosts, the "equals" method will consider them equal (and the "hashCode" method will give the same results for both) even though they clearly refer to different files since they are on different hosts. > These two methods should also factor in the HdfsFileSystem to the equation. -- This message was sent by Atlassian JIRA (v6.2#6252)