8263358: Update java.lang to use instanceof pattern variable

Reviewed-by: iris, chegar, mchung, dfuchs
This commit is contained in:
Patrick Concannon 2021-03-24 09:57:22 +00:00
parent ae9af57bf6
commit 329697b02e
18 changed files with 63 additions and 112 deletions

View file

@ -113,11 +113,10 @@ final class PublicMethods {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Key)) return false;
Key that = (Key) o;
//noinspection StringEquality (guaranteed interned String(s))
return name == that.name &&
Arrays.equals(ptypes, that.ptypes);
return (o instanceof Key that)
&& name == that.name
&& Arrays.equals(ptypes, that.ptypes);
}
@Override