mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8312089: Simplify and modernize equals, hashCode, and compareTo in java.nio and implementation code
Reviewed-by: alanb, vtewari
This commit is contained in:
parent
6a09992dbd
commit
5cc71f817f
14 changed files with 62 additions and 123 deletions
|
@ -984,6 +984,7 @@ public interface Path
|
|||
* @return {@code true} if, and only if, the given object is a {@code Path}
|
||||
* that is identical to this {@code Path}
|
||||
*/
|
||||
@Override
|
||||
boolean equals(Object other);
|
||||
|
||||
/**
|
||||
|
@ -995,10 +996,11 @@ public interface Path
|
|||
*
|
||||
* @return the hash-code value for this path
|
||||
*/
|
||||
@Override
|
||||
int hashCode();
|
||||
|
||||
/**
|
||||
* Returns the string representation of this path.
|
||||
* {@return the string representation of this path}
|
||||
*
|
||||
* <p> If this path was created by converting a path string using the
|
||||
* {@link FileSystem#getPath getPath} method then the path string returned
|
||||
|
@ -1006,8 +1008,7 @@ public interface Path
|
|||
*
|
||||
* <p> The returned path string uses the default name {@link
|
||||
* FileSystem#getSeparator separator} to separate names in the path.
|
||||
*
|
||||
* @return the string representation of this path
|
||||
*/
|
||||
@Override
|
||||
String toString();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue