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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1501,9 +1501,8 @@ public final class URI
public boolean equals(Object ob) {
if (ob == this)
return true;
if (!(ob instanceof URI))
if (!(ob instanceof URI that))
return false;
URI that = (URI)ob;
if (this.isOpaque() != that.isOpaque()) return false;
if (!equalIgnoringCase(this.scheme, that.scheme)) return false;
if (!equal(this.fragment, that.fragment)) return false;