8265426: Update java.security to use instanceof pattern variable

Reviewed-by: rriggs, weijun, dfuchs
This commit is contained in:
Patrick Concannon 2021-05-07 13:42:40 +00:00
parent 3fcdc50e44
commit 86b8dc9f5b
23 changed files with 85 additions and 165 deletions

View file

@ -123,16 +123,12 @@ public final class Timestamp implements Serializable {
* @return true if the timestamp are considered equal, false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null || (!(obj instanceof Timestamp))) {
return false;
}
Timestamp that = (Timestamp)obj;
if (this == that) {
if (this == obj) {
return true;
}
return (timestamp.equals(that.getTimestamp()) &&
signerCertPath.equals(that.getSignerCertPath()));
return obj instanceof Timestamp other
&& (timestamp.equals(other.getTimestamp()) &&
signerCertPath.equals(other.getSignerCertPath()));
}
/**