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

@ -1427,11 +1427,8 @@ public class Runtime {
public boolean equalsIgnoreOptional(Object obj) {
if (this == obj)
return true;
if (!(obj instanceof Version))
return false;
Version that = (Version)obj;
return (this.version().equals(that.version())
return (obj instanceof Version that)
&& (this.version().equals(that.version())
&& this.pre().equals(that.pre())
&& this.build().equals(that.build()));
}