Given a test scenario:
public void test_Equals_Scenario7() {
UnresolvedPermission up1 = new UnresolvedPermission(type, name,
action,
new java.security.cert.Certificate[] {cert1, cert2});
UnresolvedPermission up2 = new UnresolvedPermission(type, name,
action,
new java.security.cert.Certificate[] {cert1, null, null,
null, cert2});
assertFalse(up1.equals(up2));
}
up1 has a 2-elements Certificate array, and up2 has a 5-elements Certificate
array.
If conducting it on the previous UnresolvedPermission, it returns true.
Because the previous implementation ignores null-certificate variable in the
array, then decide the equality between new Certificate[] {cert1, cert2} and
new Certificate[] {cert1, cert2}.
RI behave differently here, it will not take the null value in
considerations.
I agree to make a defensive copy fix in the 1st patch. Will attach it on the
issue soon.
Tony, would you please help to review this later?