mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8263358: Update java.lang to use instanceof pattern variable
Reviewed-by: iris, chegar, mchung, dfuchs
This commit is contained in:
parent
ae9af57bf6
commit
329697b02e
18 changed files with 63 additions and 112 deletions
|
@ -1818,13 +1818,9 @@ public final class String
|
|||
if (this == anObject) {
|
||||
return true;
|
||||
}
|
||||
if (anObject instanceof String) {
|
||||
String aString = (String)anObject;
|
||||
if (!COMPACT_STRINGS || this.coder == aString.coder) {
|
||||
return StringLatin1.equals(value, aString.value);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return (anObject instanceof String aString)
|
||||
&& (!COMPACT_STRINGS || this.coder == aString.coder)
|
||||
&& StringLatin1.equals(value, aString.value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue