commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Whitcomb <Roger.Whitc...@actian.com>
Subject [VFS] Funny result for HDFS FileObject.equals
Date Mon, 05 May 2014 22:40:48 GMT
Hi,
                I'm using Commons VFS inside an Apache Pivot remote file browser and I'm getting
a strange result when switching between different HDFS hosts.  I have two FileObjects, with
different host:port (but the same directory name), and they compare equal (i.e., the FileObject.equals(...)
method returns true, when they are clearly not the same.  Any thoughts?
                Here is the code and my results:
System.out.format("VFSBrowserSheet.setRootDirectory: does '%1$s' exist()? %2$s%n", rootDirectory,
rootDirectory.exists());
        if (rootDirectory.exists()) {
            FileObject previousRootDirectory = this.rootDirectory;

System.out.format("VFSBrowserSheet.setRootDirectory: previousRootDirectory = %1$s%n", previousRootDirectory);
System.out.format("VFSBrowserSheet.setRootDirectory: rootDirectory[%1$s].equals(previousRootDirectory[%2$s])?
%3$s%n", rootDirectory, previousRootDirectory, rootDirectory.equals(previousRootDirectory));
            if (!rootDirectory.equals(previousRootDirectory)) {
                this.rootDirectory = rootDirectory;
                selectedFiles.clear();
System.out.format("VFSBrowserSheet.setRootDirectory, calling 'rootDirectoryChanged'%n");
                fileBrowserSheetListeners.rootDirectoryChanged(this, previousRootDirectory);
            }

VFSBrowserSheet.setRootDirectory: does 'hdfs://chhadoop-master:9000/' exist()? true
VFSBrowserSheet.setRootDirectory: previousRootDirectory = hdfs://chcluster2-master:8020/
VFSBrowserSheet.setRootDirectory: rootDirectory[hdfs://chhadoop-master:9000/].equals(previousRootDirectory[hdfs://chcluster2-master:8020/])?
True

Thanks,
~Roger Whitcomb



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message