8263233: Update java.net and java.nio to use instanceof pattern variable

Reviewed-by: dfuchs, bpb, chegar, michaelm
This commit is contained in:
Patrick Concannon 2021-03-10 11:05:29 +00:00
parent 3fe8a4661c
commit fdd3941121
17 changed files with 39 additions and 73 deletions

View file

@ -972,9 +972,8 @@ public final class URL implements java.io.Serializable {
* {@code false} otherwise.
*/
public boolean equals(Object obj) {
if (!(obj instanceof URL))
if (!(obj instanceof URL u2))
return false;
URL u2 = (URL)obj;
return handler.equals(this, u2);
}