mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8258422: Cleanup unnecessary null comparison before instanceof check in java.base
Reviewed-by: chegar, aefimov
This commit is contained in:
parent
ff54b77b76
commit
022bc9f0cb
22 changed files with 69 additions and 81 deletions
|
@ -878,12 +878,10 @@ class Inet6Address extends InetAddress {
|
|||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null || !(obj instanceof Inet6Address))
|
||||
return false;
|
||||
|
||||
Inet6Address inetAddr = (Inet6Address)obj;
|
||||
|
||||
return holder6.equals(inetAddr.holder6);
|
||||
if (obj instanceof Inet6Address inetAddr) {
|
||||
return holder6.equals(inetAddr.holder6);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue