mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8265426: Update java.security to use instanceof pattern variable
Reviewed-by: rriggs, weijun, dfuchs
This commit is contained in:
parent
3fcdc50e44
commit
86b8dc9f5b
23 changed files with 85 additions and 165 deletions
|
@ -334,20 +334,12 @@ public abstract class Identity implements Principal, Serializable {
|
|||
* @see #identityEquals
|
||||
*/
|
||||
public final boolean equals(Object identity) {
|
||||
|
||||
if (identity == this) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (identity instanceof Identity) {
|
||||
Identity i = (Identity)identity;
|
||||
if (this.fullName().equals(i.fullName())) {
|
||||
return true;
|
||||
} else {
|
||||
return identityEquals(i);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return identity instanceof Identity other
|
||||
&& (this.fullName().equals(other.fullName()) || identityEquals(other));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue