提交 2fd3b751 编写于 作者: A alanb

7020517: (fs) FileStore.equals returns true if both volumes have the same serial number

Reviewed-by: chegar
上级 f29071a2
...@@ -201,13 +201,12 @@ class WindowsFileStore ...@@ -201,13 +201,12 @@ class WindowsFileStore
if (!(ob instanceof WindowsFileStore)) if (!(ob instanceof WindowsFileStore))
return false; return false;
WindowsFileStore other = (WindowsFileStore)ob; WindowsFileStore other = (WindowsFileStore)ob;
return this.volInfo.volumeSerialNumber() == other.volInfo.volumeSerialNumber(); return root.equals(other.root);
} }
@Override @Override
public int hashCode() { public int hashCode() {
// reveals VSN without permission check - okay? return root.hashCode();
return volInfo.volumeSerialNumber();
} }
@Override @Override
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
*/ */
/* @test /* @test
* @bug 4313887 6873621 6979526 7006126 * @bug 4313887 6873621 6979526 7006126 7020517
* @summary Unit test for java.nio.file.FileStore * @summary Unit test for java.nio.file.FileStore
* @library .. * @library ..
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册