8258422: Cleanup unnecessary null comparison before instanceof check in java.base

Reviewed-by: chegar, aefimov
This commit is contained in:
Andrey Turbanov 2021-01-11 23:30:44 +00:00 committed by Aleksei Efimov
parent ff54b77b76
commit 022bc9f0cb
22 changed files with 69 additions and 81 deletions

View file

@ -146,9 +146,8 @@ public class Proxy {
* @see java.net.InetSocketAddress#equals(java.lang.Object)
*/
public final boolean equals(Object obj) {
if (obj == null || !(obj instanceof Proxy))
if (!(obj instanceof Proxy p))
return false;
Proxy p = (Proxy) obj;
if (p.type() == type()) {
if (address() == null) {
return (p.address() == null);