commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1642530 - in /commons/proper/vfs/trunk: core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java src/changes/changes.xml
Date Sun, 30 Nov 2014 09:20:55 GMT
Author: ecki
Date: Sun Nov 30 09:20:55 2014
New Revision: 1642530

URL: http://svn.apache.org/r1642530
Log:
[VFS-523] HdfsFileObject uses super equals/hashcode like all FOs

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
    commons/proper/vfs/trunk/src/changes/changes.xml

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java?rev=1642530&r1=1642529&r2=1642530&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java
Sun Nov 30 09:20:55 2014
@@ -35,7 +35,7 @@ import org.apache.hadoop.fs.Path;
 
 /**
  * A VFS representation of an HDFS file.
- * 
+ *
  * @since 2.1
  */
 public class HdfsFileObject extends AbstractFileObject<HdfsFileSystem>
@@ -47,7 +47,7 @@ public class HdfsFileObject extends Abst
 
     /**
      * Constructs a new HDFS FileObject
-     * 
+     *
      * @param name
      *            FileName
      * @param fs
@@ -210,15 +210,6 @@ public class HdfsFileObject extends Abst
     }
 
     /**
-     * @see org.apache.commons.vfs2.provider.AbstractFileObject#doIsSameFile(org.apache.commons.vfs2.FileObject)
-     */
-    @Override
-    protected boolean doIsSameFile(final FileObject destFile) throws FileSystemException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    /**
      * @see org.apache.commons.vfs2.provider.AbstractFileObject#doIsWriteable()
      */
     @Override
@@ -296,31 +287,6 @@ public class HdfsFileObject extends Abst
     }
 
     /**
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(final Object o)
-    {
-        if (null == o)
-        {
-            return false;
-        }
-        if (o == this)
-        {
-            return true;
-        }
-        if (o instanceof HdfsFileObject)
-        {
-            final HdfsFileObject other = (HdfsFileObject) o;
-            if (other.path.equals(this.path))
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
      * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists()
      * @return boolean true if file exists, false if not
      */
@@ -342,13 +308,4 @@ public class HdfsFileObject extends Abst
         }
     }
 
-    /**
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode()
-    {
-        return this.path.getName().toString().hashCode();
-    }
-
 }

Modified: commons/proper/vfs/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/src/changes/changes.xml?rev=1642530&r1=1642529&r2=1642530&view=diff
==============================================================================
--- commons/proper/vfs/trunk/src/changes/changes.xml (original)
+++ commons/proper/vfs/trunk/src/changes/changes.xml Sun Nov 30 09:20:55 2014
@@ -26,6 +26,10 @@
 <!--       <action issue="VFS-443" dev="ggregory" type="update" due-to="nickallen">
-->
 <!--        [Local] Need an easy way to convert from a FileObject to a File. -->
 <!--       </action> -->
+      <action issue="VFS-523" dev="ecki" type="fix" due-to="Roger Whitcomb">
+       [HDFS] Make HdfsFileObject.equal use system hashcode/equals instead of 
+       wrongly comparing file path only.
+      </action>
       <action issue="VFS-544" dev="ecki" type="fix">
        [Virtual] Allow virtual file systems and virtual file system provider
        to be closed, to avoid memory leak.



Mime
View raw message