8130274: java/nio/file/FileStore/Basic.java fails when two successive stores in an iteration are determined to be equal
authorbpb
Fri, 31 Jul 2015 07:12:36 -0700 (2015-07-31)
changeset 32007 d8dbfb03a3e7
parent 32006 97c6167e698a
child 32008 55efc6c88c68
8130274: java/nio/file/FileStore/Basic.java fails when two successive stores in an iteration are determined to be equal Summary: Make UnixFileStore.equals() also compare the return values of name(), the names of the mounted filesystems. Reviewed-by: alanb
jdk/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java
--- a/jdk/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java	Fri Jul 31 07:04:48 2015 -0700
+++ b/jdk/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java	Fri Jul 31 07:12:36 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -186,7 +186,8 @@
             return false;
         UnixFileStore other = (UnixFileStore)ob;
         return (this.dev == other.dev) &&
-               Arrays.equals(this.entry.dir(), other.entry.dir());
+               Arrays.equals(this.entry.dir(), other.entry.dir()) &&
+               this.entry.name().equals(other.entry.name());
     }
 
     @Override