mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8267110: Update java.util to use instanceof pattern variable
Reviewed-by: lancea, naoto
This commit is contained in:
parent
0a03fc84b3
commit
a52c4ede2f
29 changed files with 142 additions and 266 deletions
|
@ -885,10 +885,9 @@ public final class Locale implements Cloneable, Serializable {
|
|||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof LocaleKey)) {
|
||||
if (!(obj instanceof LocaleKey other)) {
|
||||
return false;
|
||||
}
|
||||
LocaleKey other = (LocaleKey)obj;
|
||||
if (hash != other.hash || !base.equals(other.base)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -3341,12 +3340,9 @@ public final class Locale implements Cloneable, Serializable {
|
|||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof LanguageRange)) {
|
||||
return false;
|
||||
}
|
||||
LanguageRange other = (LanguageRange)obj;
|
||||
return range.equals(other.range)
|
||||
&& weight == other.weight;
|
||||
return obj instanceof LanguageRange other
|
||||
&& range.equals(other.range)
|
||||
&& weight == other.weight;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue