mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +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
|
@ -217,13 +217,12 @@ public class ECFieldF2m implements ECField {
|
|||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (obj instanceof ECFieldF2m) {
|
||||
|
||||
return obj instanceof ECFieldF2m other
|
||||
// no need to compare rp here since ks and rp
|
||||
// should be equivalent
|
||||
return ((m == ((ECFieldF2m)obj).m) &&
|
||||
(Arrays.equals(ks, ((ECFieldF2m) obj).ks)));
|
||||
}
|
||||
return false;
|
||||
&& (m == other.m)
|
||||
&& (Arrays.equals(ks, other.ks));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -82,10 +82,9 @@ public class ECFieldFp implements ECField {
|
|||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (obj instanceof ECFieldFp) {
|
||||
return (p.equals(((ECFieldFp)obj).p));
|
||||
}
|
||||
return false;
|
||||
|
||||
return obj instanceof ECFieldFp other
|
||||
&& p.equals(other.p);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -96,11 +96,10 @@ public class ECPoint {
|
|||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (this == POINT_INFINITY) return false;
|
||||
if (obj instanceof ECPoint) {
|
||||
return ((x.equals(((ECPoint)obj).x)) &&
|
||||
(y.equals(((ECPoint)obj).y)));
|
||||
}
|
||||
return false;
|
||||
|
||||
return obj instanceof ECPoint other
|
||||
&& ((x.equals(other.x))
|
||||
&& (y.equals(other.y)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -169,15 +169,11 @@ public class EllipticCurve {
|
|||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (obj instanceof EllipticCurve) {
|
||||
EllipticCurve curve = (EllipticCurve) obj;
|
||||
if ((field.equals(curve.field)) &&
|
||||
(a.equals(curve.a)) &&
|
||||
(b.equals(curve.b))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
return obj instanceof EllipticCurve other
|
||||
&& field.equals(other.field)
|
||||
&& a.equals(other.a)
|
||||
&& b.equals(other.b);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue