提交 73b00f40 编写于 作者: A alanb

6979526: (file) java/nio/file/FileStore/Basic.java fails if the same file...

6979526: (file) java/nio/file/FileStore/Basic.java fails if the same file system is mounted more than once
Reviewed-by: kevinw, forax
上级 8cfd77bd
......@@ -156,9 +156,4 @@ class LinuxFileStore
return supportsFileAttributeView(UserDefinedFileAttributeView.class);
return super.supportsFileAttributeView(name);
}
@Override
boolean isLoopback() {
return false;
}
}
......@@ -108,9 +108,4 @@ class SolarisFileStore
return supportsFileAttributeView(UserDefinedFileAttributeView.class);
return super.supportsFileAttributeView(name);
}
@Override
boolean isLoopback() {
return type().equals("lofs");
}
}
......@@ -76,12 +76,6 @@ abstract class UnixFileStore
*/
abstract UnixMountEntry findMountEntry() throws IOException;
/**
* Returns true if this file store represents a loopback file system that
* will have the same device ID as underlying file system.
*/
abstract boolean isLoopback();
UnixPath file() {
return file;
}
......@@ -169,22 +163,13 @@ abstract class UnixFileStore
if (!(ob instanceof UnixFileStore))
return false;
UnixFileStore other = (UnixFileStore)ob;
if (dev != other.dev)
return false;
// deviceIDs are equal but they may not be equal if one or both of
// them is a loopback file system
boolean thisIsLoopback = isLoopback();
if (thisIsLoopback != other.isLoopback())
return false; // one, but not both, are lofs
if (!thisIsLoopback)
return true; // neither is lofs
// both are lofs so compare mount points
return Arrays.equals(this.entry.dir(), other.entry.dir());
return (this.dev == other.dev) &&
Arrays.equals(this.entry.dir(), other.entry.dir());
}
@Override
public int hashCode() {
return (int)(dev ^ (dev >>> 32));
return (int)(dev ^ (dev >>> 32)) ^ Arrays.hashCode(entry.dir());
}
@Override
......
......@@ -22,7 +22,7 @@
*/
/* @test
* @bug 4313887 6873621
* @bug 4313887 6873621 6979526
* @summary Unit test for java.nio.file.FileStore
* @library ..
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册