harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Zhou" <zhoukevi...@gmail.com>
Subject Re: [jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
Date Fri, 19 Dec 2008 03:42:33 GMT
 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?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message