changeset 3807:dbdafe65af60

7020517: (fs) FileStore.equals returns true if both volumes have the same serial number Reviewed-by: chegar
author alanb
date Mon, 21 Feb 2011 13:54:13 +0000
parents 5bf920749b97
children d7cb44a4d08a
files src/windows/classes/sun/nio/fs/WindowsFileStore.java test/java/nio/file/FileStore/Basic.java
diffstat 2 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/classes/sun/nio/fs/WindowsFileStore.java	Fri Feb 18 12:43:14 2011 -0800
+++ b/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/test/java/nio/file/FileStore/Basic.java	Fri Feb 18 12:43:14 2011 -0800
+++ b/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 ..
  */