Skip to content

Commit

Permalink
8263233: Refactored equals method further
Browse files Browse the repository at this point in the history
  • Loading branch information
pconcannon committed Mar 9, 2021
1 parent eca9095 commit 27a5892
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/java.base/share/classes/java/net/InterfaceAddress.java
Expand Up @@ -101,12 +101,10 @@ public short getNetworkPrefixLength() {
* @see java.net.InterfaceAddress#hashCode()
*/
public boolean equals(Object obj) {
if (obj instanceof InterfaceAddress cmp) {
return Objects.equals(address, cmp.address) &&
Objects.equals(broadcast, cmp.broadcast) &&
maskLength == cmp.maskLength;
}
return false;
return obj instanceof InterfaceAddress cmp &&
Objects.equals(address, cmp.address) &&
Objects.equals(broadcast, cmp.broadcast) &&
maskLength == cmp.maskLength;
}

/**
Expand Down

0 comments on commit 27a5892

Please sign in to comment.