mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8226831: Use Objects.equals() when appropriate
Reviewed-by: rriggs, bpb
This commit is contained in:
parent
99bf89c581
commit
3ed845784d
7 changed files with 26 additions and 31 deletions
|
@ -30,6 +30,7 @@ import java.io.InputStream;
|
|||
import java.io.File;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Objects;
|
||||
import sun.net.util.IPAddressUtil;
|
||||
import sun.net.www.ParseUtil;
|
||||
|
||||
|
@ -343,10 +344,7 @@ public abstract class URLStreamHandler {
|
|||
* @since 1.3
|
||||
*/
|
||||
protected boolean equals(URL u1, URL u2) {
|
||||
String ref1 = u1.getRef();
|
||||
String ref2 = u2.getRef();
|
||||
return (ref1 == ref2 || (ref1 != null && ref1.equals(ref2))) &&
|
||||
sameFile(u1, u2);
|
||||
return Objects.equals(u1.getRef(), u2.getRef()) && sameFile(u1, u2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue