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
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2023, 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
|
||||
|
@ -234,9 +234,8 @@ abstract class UnixFileStore
|
|||
public boolean equals(Object ob) {
|
||||
if (ob == this)
|
||||
return true;
|
||||
if (!(ob instanceof UnixFileStore))
|
||||
if (!(ob instanceof UnixFileStore other))
|
||||
return false;
|
||||
UnixFileStore other = (UnixFileStore)ob;
|
||||
return (this.dev == other.dev) &&
|
||||
Arrays.equals(this.entry.dir(), other.entry.dir()) &&
|
||||
this.entry.name().equals(other.entry.name());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue