[ 
https://issues.apache.org/jira/browse/VFS-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14000582#comment-14000582
 ] 

Bernd Eckenfels commented on VFS-523:
-------------------------------------

I just checked the other FileObject implementations, none of them overwrites 
the basic equals/hashcode implementation. I wonder if a (better/other) solution 
would be to remove the implementations?

Using same object compare and system hashcode would work in most situations 
where the caching is used.

If we think this is not enough, then maybe it would be better to add 
hashcode+equals to the AbstractFileObject where it would compare the fileName 
and the filesystem (instance).

> 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
>
>
> 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)

Reply via email to