mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +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
|
@ -352,8 +352,8 @@ class Inet4Address extends InetAddress {
|
|||
* @see java.net.InetAddress#getAddress()
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
return (obj != null) && (obj instanceof Inet4Address) &&
|
||||
(((InetAddress)obj).holder().getAddress() == holder().getAddress());
|
||||
return (obj instanceof Inet4Address inet4Address) &&
|
||||
inet4Address.holder().getAddress() == holder().getAddress();
|
||||
}
|
||||
|
||||
// Utilities
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue