7020517: (fs) FileStore.equals returns true if both volumes have the same serial number
Reviewed-by: chegar
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java Fri Feb 18 12:43:14 2011 -0800
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java Mon Feb 21 13:54:13 2011 +0000
@@ -201,13 +201,12 @@
if (!(ob instanceof WindowsFileStore))
return false;
WindowsFileStore other = (WindowsFileStore)ob;
- return this.volInfo.volumeSerialNumber() == other.volInfo.volumeSerialNumber();
+ return root.equals(other.root);
}
@Override
public int hashCode() {
- // reveals VSN without permission check - okay?
- return volInfo.volumeSerialNumber();
+ return root.hashCode();
}
@Override
--- a/jdk/test/java/nio/file/FileStore/Basic.java Fri Feb 18 12:43:14 2011 -0800
+++ b/jdk/test/java/nio/file/FileStore/Basic.java Mon Feb 21 13:54:13 2011 +0000
@@ -22,7 +22,7 @@
*/
/* @test
- * @bug 4313887 6873621 6979526 7006126
+ * @bug 4313887 6873621 6979526 7006126 7020517
* @summary Unit test for java.nio.file.FileStore
* @library ..
*/