You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Kevin Zhou (JIRA)" <ji...@apache.org> on 2008/12/12 07:28:44 UTC

[jira] Created: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

[classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
----------------------------------------------------------------------------

                 Key: HARMONY-6043
                 URL: https://issues.apache.org/jira/browse/HARMONY-6043
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M8
            Reporter: Kevin Zhou
             Fix For: 5.0M9


Given a test case[1], RI works well while HARMONY fails.

[1] UnresolvedPermissionTest 
public class UnresolvedPermissionTest extends TestCase {
    public static final String type = "java.util.PropertyPermission";
    public static final String name = "os.name";
    public static final String action = "write,read";
    public void test_Scenario0() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                null);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                null);
        assertEquals(up1, up2);
    }

    public void test_Scenario1() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                null);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[0]);
        assertFalse(up1.equals(up2));
    }

    public void test_Scenario2() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                null);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[2]);
        assertFalse(up1.equals(up2));
    }

    public void test_Scenario3() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[0]);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[0]);
        assertEquals(up1, up2);
    }

    public void test_Scenario4() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[0]);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[2]);
        assertFalse(up1.equals(up2));
    }

    public void test_Scenario5() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[2]);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[2]);
        try {
            up1.equals(up2);
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // Expected
        }
    }

    public void test_Scenario6() {
        UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[2]);
        UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
                new java.security.cert.Certificate[5]);
        assertFalse(up1.equals(up2));
    }
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by Tony Wu <wu...@gmail.com>.
Hi, Kevin and Alexey

I've committed this patch here[1] with a work around to NullPointerException.

[1] http://svn.apache.org/viewvc?view=rev&revision=728589

On Fri, Dec 19, 2008 at 11:42 AM, Kevin Zhou <zh...@gmail.com> wrote:
>  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?
>



-- 
Tony Wu
China Software Development Lab, IBM

Re: [jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by Kevin Zhou <zh...@gmail.com>.
 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?

Re: [jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by Alexey Varlamov <al...@gmail.com>.
Guys, please fix at least the defensive copying and NPE in equals(),
these are plain bugs.
However, if you'd try to comply with the formal specification which
explicitly mandates copying and comparing only actual signer
certificates, you'd get back to the initial version ;)
To be honest, the spec and API is somewhat vague and seems being a
part of implicit contract with (default) Policy provider. From the
common sense, null element in certificates array are just invalid
argument to UnresovledPermission constructor which should therefore
throw an exception, but it is the way it is.

Thanks,
Alexey

2008/12/15, Kevin Zhou <zh...@gmail.com>:
> Yes, I also agree on on the defensive copy.
>
> On Mon, Dec 15, 2008 at 11:36 AM, Tony Wu <wu...@gmail.com> wrote:
>
> > On Mon, Dec 15, 2008 at 2:18 AM, Alexey Varlamov
> > <al...@gmail.com> wrote:
> > > 2008/12/13 Kevin Zhou <zh...@gmail.com>:
> > >> Alexey wrote,
> > >>> One must make defensive copy when setting array properties - plain
> > >> assigment of array reference is unsafe.
> > >> Yes, this assigment of arry reference is unsafe. But no spec says that
> > the
> > >> array of certificates in a UnresovledPermission need to be thread-safe.
> > >> If we add a lock to guarantee its safe, how about the other methods
> > which
> > >> access to targetCerts array. Do we need to make them safe too?
> > >
> > > I did not mean thread safety here, rather internal object integrity.
> > > BTW, API spec directly says: "The signer certificates are copied from
> > > the array. Subsequent changes to the array will not affect this
> > > UnsolvedPermission."
> > > The same precautions are already in place where needed.
> > >
> >
> > Alexey, I agree with you on the defensive copy.
> >
> > >>>Looking on the test source, I'd rather consider this as non-bug
> > difference.
> > >>
> > >> I think this is different behaviors between RI and HARMONY of
> > determining
> > >> certificate equality?
> > >> The previous implementation of HARMONY uses PolicyUtils.matchSubSet
> > method
> > >> which behaves differently from RI.
> > >>
> > >> I think we'd better follow RI's behaviors on this.
> > > This is better only if RI's behaviour is logical and consistent or
> > > became widely adapted feature. This is not the case here. E.g.,
> > > throwing NPE on equals() invocation is always considered bad practice,
> > > etc. Moreover, I wonder if RI is compliant with spec which says: "To
> > > determine certificate equality, this method only compares actual
> > > signer certificates. "
> > > So I suggest to rollback the patch and mark the issue "non-bug
> > difference".
> > >
> >
> > I think there is a behavior difference if we leave this gap in our
> > code. The difference is how do we do when encountering a null
> > certificate. RI takes it into consideration and Harmony just ignore
> > it. this difference itself is trival but will result in the different
> > behavior in security.  For example,  following two instances of
> > UnresolvedPermission are considered as equal with Harmony but just not
> > with RI.
> >
> > new UnresolvedPermission(type, name, action, new
> > java.security.cert.Certificate[]{cert1, null})
> > new UnresolvedPermission(type, name, action, new
> > java.security.cert.Certificate[]{cert1})
> >
> > I can not tell what's the impact to any product exactly at this time
> > but I'd like to mitigate the risk of creating a security hole.
> >
> > > --
> > > Alexey
> > >
> >
> >
> >
> > --
> > Tony Wu
> > China Software Development Lab, IBM
> >
>

Re: [jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by Kevin Zhou <zh...@gmail.com>.
Yes, I also agree on on the defensive copy.

On Mon, Dec 15, 2008 at 11:36 AM, Tony Wu <wu...@gmail.com> wrote:

> On Mon, Dec 15, 2008 at 2:18 AM, Alexey Varlamov
> <al...@gmail.com> wrote:
> > 2008/12/13 Kevin Zhou <zh...@gmail.com>:
> >> Alexey wrote,
> >>> One must make defensive copy when setting array properties - plain
> >> assigment of array reference is unsafe.
> >> Yes, this assigment of arry reference is unsafe. But no spec says that
> the
> >> array of certificates in a UnresovledPermission need to be thread-safe.
> >> If we add a lock to guarantee its safe, how about the other methods
> which
> >> access to targetCerts array. Do we need to make them safe too?
> >
> > I did not mean thread safety here, rather internal object integrity.
> > BTW, API spec directly says: "The signer certificates are copied from
> > the array. Subsequent changes to the array will not affect this
> > UnsolvedPermission."
> > The same precautions are already in place where needed.
> >
>
> Alexey, I agree with you on the defensive copy.
>
> >>>Looking on the test source, I'd rather consider this as non-bug
> difference.
> >>
> >> I think this is different behaviors between RI and HARMONY of
> determining
> >> certificate equality?
> >> The previous implementation of HARMONY uses PolicyUtils.matchSubSet
> method
> >> which behaves differently from RI.
> >>
> >> I think we'd better follow RI's behaviors on this.
> > This is better only if RI's behaviour is logical and consistent or
> > became widely adapted feature. This is not the case here. E.g.,
> > throwing NPE on equals() invocation is always considered bad practice,
> > etc. Moreover, I wonder if RI is compliant with spec which says: "To
> > determine certificate equality, this method only compares actual
> > signer certificates. "
> > So I suggest to rollback the patch and mark the issue "non-bug
> difference".
> >
>
> I think there is a behavior difference if we leave this gap in our
> code. The difference is how do we do when encountering a null
> certificate. RI takes it into consideration and Harmony just ignore
> it. this difference itself is trival but will result in the different
> behavior in security.  For example,  following two instances of
> UnresolvedPermission are considered as equal with Harmony but just not
> with RI.
>
> new UnresolvedPermission(type, name, action, new
> java.security.cert.Certificate[]{cert1, null})
> new UnresolvedPermission(type, name, action, new
> java.security.cert.Certificate[]{cert1})
>
> I can not tell what's the impact to any product exactly at this time
> but I'd like to mitigate the risk of creating a security hole.
>
> > --
> > Alexey
> >
>
>
>
> --
> Tony Wu
> China Software Development Lab, IBM
>

Re: [jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by Tony Wu <wu...@gmail.com>.
On Mon, Dec 15, 2008 at 2:18 AM, Alexey Varlamov
<al...@gmail.com> wrote:
> 2008/12/13 Kevin Zhou <zh...@gmail.com>:
>> Alexey wrote,
>>> One must make defensive copy when setting array properties - plain
>> assigment of array reference is unsafe.
>> Yes, this assigment of arry reference is unsafe. But no spec says that the
>> array of certificates in a UnresovledPermission need to be thread-safe.
>> If we add a lock to guarantee its safe, how about the other methods which
>> access to targetCerts array. Do we need to make them safe too?
>
> I did not mean thread safety here, rather internal object integrity.
> BTW, API spec directly says: "The signer certificates are copied from
> the array. Subsequent changes to the array will not affect this
> UnsolvedPermission."
> The same precautions are already in place where needed.
>

Alexey, I agree with you on the defensive copy.

>>>Looking on the test source, I'd rather consider this as non-bug difference.
>>
>> I think this is different behaviors between RI and HARMONY of determining
>> certificate equality?
>> The previous implementation of HARMONY uses PolicyUtils.matchSubSet method
>> which behaves differently from RI.
>>
>> I think we'd better follow RI's behaviors on this.
> This is better only if RI's behaviour is logical and consistent or
> became widely adapted feature. This is not the case here. E.g.,
> throwing NPE on equals() invocation is always considered bad practice,
> etc. Moreover, I wonder if RI is compliant with spec which says: "To
> determine certificate equality, this method only compares actual
> signer certificates. "
> So I suggest to rollback the patch and mark the issue "non-bug difference".
>

I think there is a behavior difference if we leave this gap in our
code. The difference is how do we do when encountering a null
certificate. RI takes it into consideration and Harmony just ignore
it. this difference itself is trival but will result in the different
behavior in security.  For example,  following two instances of
UnresolvedPermission are considered as equal with Harmony but just not
with RI.

new UnresolvedPermission(type, name, action, new
java.security.cert.Certificate[]{cert1, null})
new UnresolvedPermission(type, name, action, new
java.security.cert.Certificate[]{cert1})

I can not tell what's the impact to any product exactly at this time
but I'd like to mitigate the risk of creating a security hole.

> --
> Alexey
>



-- 
Tony Wu
China Software Development Lab, IBM

Re: [jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by Alexey Varlamov <al...@gmail.com>.
2008/12/13 Kevin Zhou <zh...@gmail.com>:
> Alexey wrote,
>> One must make defensive copy when setting array properties - plain
> assigment of array reference is unsafe.
> Yes, this assigment of arry reference is unsafe. But no spec says that the
> array of certificates in a UnresovledPermission need to be thread-safe.
> If we add a lock to guarantee its safe, how about the other methods which
> access to targetCerts array. Do we need to make them safe too?

I did not mean thread safety here, rather internal object integrity.
BTW, API spec directly says: "The signer certificates are copied from
the array. Subsequent changes to the array will not affect this
UnsolvedPermission."
The same precautions are already in place where needed.

>>Looking on the test source, I'd rather consider this as non-bug difference.
>
> I think this is different behaviors between RI and HARMONY of determining
> certificate equality?
> The previous implementation of HARMONY uses PolicyUtils.matchSubSet method
> which behaves differently from RI.
>
> I think we'd better follow RI's behaviors on this.
This is better only if RI's behaviour is logical and consistent or
became widely adapted feature. This is not the case here. E.g.,
throwing NPE on equals() invocation is always considered bad practice,
etc. Moreover, I wonder if RI is compliant with spec which says: "To
determine certificate equality, this method only compares actual
signer certificates. "
So I suggest to rollback the patch and mark the issue "non-bug difference".

--
Alexey

Re: [jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by Kevin Zhou <zh...@gmail.com>.
How about this assignment?
if(certs != null){
    targetCerts = new Certificate[certs.length];
    System.arraycopy(certs, 0, targetCerts, 0, certs.length);
}

Re: [jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by Kevin Zhou <zh...@gmail.com>.
Alexey wrote,
> One must make defensive copy when setting array properties - plain
assigment of array reference is unsafe.
Yes, this assigment of arry reference is unsafe. But no spec says that the
array of certificates in a UnresovledPermission need to be thread-safe.
If we add a lock to guarantee its safe, how about the other methods which
access to targetCerts array. Do we need to make them safe too?

>Looking on the test source, I'd rather consider this as non-bug difference.

I think this is different behaviors between RI and HARMONY of determining
certificate equality?
The previous implementation of HARMONY uses PolicyUtils.matchSubSet method
which behaves differently from RI.

I think we'd better follow RI's behaviors on this.

[jira] Updated: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Zhou updated HARMONY-6043:
--------------------------------

    Attachment: HARMONY-6043.diff

Would you please help to try it?

> [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-6043
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6043
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6043.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Given a test case[1], RI works well while HARMONY fails.
> [1] UnresolvedPermissionTest 
> public class UnresolvedPermissionTest extends TestCase {
>     public static final String type = "java.util.PropertyPermission";
>     public static final String name = "os.name";
>     public static final String action = "write,read";
>     public void test_Scenario0() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 null);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario1() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario2() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario3() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario4() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario5() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         try {
>             up1.equals(up2);
>             fail("should throw NullPointerException");
>         } catch (NullPointerException e) {
>             // Expected
>         }
>     }
>     public void test_Scenario6() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[5]);
>         assertFalse(up1.equals(up2));
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Zhou resolved HARMONY-6043.
---------------------------------

    Resolution: Fixed

> [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-6043
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6043
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>            Assignee: Tony Wu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6043.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Given a test case[1], RI works well while HARMONY fails.
> [1] UnresolvedPermissionTest 
> public class UnresolvedPermissionTest extends TestCase {
>     public static final String type = "java.util.PropertyPermission";
>     public static final String name = "os.name";
>     public static final String action = "write,read";
>     public void test_Scenario0() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 null);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario1() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario2() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario3() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario4() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario5() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         try {
>             up1.equals(up2);
>             fail("should throw NullPointerException");
>         } catch (NullPointerException e) {
>             // Expected
>         }
>     }
>     public void test_Scenario6() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[5]);
>         assertFalse(up1.equals(up2));
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu reassigned HARMONY-6043:
--------------------------------

    Assignee: Tony Wu

> [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-6043
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6043
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>            Assignee: Tony Wu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6043.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Given a test case[1], RI works well while HARMONY fails.
> [1] UnresolvedPermissionTest 
> public class UnresolvedPermissionTest extends TestCase {
>     public static final String type = "java.util.PropertyPermission";
>     public static final String name = "os.name";
>     public static final String action = "write,read";
>     public void test_Scenario0() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 null);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario1() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario2() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario3() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario4() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario5() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         try {
>             up1.equals(up2);
>             fail("should throw NullPointerException");
>         } catch (NullPointerException e) {
>             // Expected
>         }
>     }
>     public void test_Scenario6() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[5]);
>         assertFalse(up1.equals(up2));
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Varlamov reopened HARMONY-6043:
--------------------------------------


Guys, the patch is not really good.. One must make defensive copy when setting array properties - plain assigment of array reference is unsafe.

Also, it is not really clear from the report what the problem is?  I have no Harmony build at hand nor RI 1.6 nearby, could you please cite console logs for the both runtimes?



> [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-6043
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6043
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>            Assignee: Tony Wu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6043.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Given a test case[1], RI works well while HARMONY fails.
> [1] UnresolvedPermissionTest 
> public class UnresolvedPermissionTest extends TestCase {
>     public static final String type = "java.util.PropertyPermission";
>     public static final String name = "os.name";
>     public static final String action = "write,read";
>     public void test_Scenario0() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 null);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario1() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario2() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario3() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario4() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario5() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         try {
>             up1.equals(up2);
>             fail("should throw NullPointerException");
>         } catch (NullPointerException e) {
>             // Expected
>         }
>     }
>     public void test_Scenario6() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[5]);
>         assertFalse(up1.equals(up2));
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Zhou updated HARMONY-6043:
--------------------------------

    Attachment: HARMONY-6043v2.diff

Would you please help to try it?

> [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-6043
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6043
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>            Assignee: Tony Wu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6043.diff, HARMONY-6043v2.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Given a test case[1], RI works well while HARMONY fails.
> [1] UnresolvedPermissionTest 
> public class UnresolvedPermissionTest extends TestCase {
>     public static final String type = "java.util.PropertyPermission";
>     public static final String name = "os.name";
>     public static final String action = "write,read";
>     public void test_Scenario0() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 null);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario1() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario2() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario3() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario4() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario5() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         try {
>             up1.equals(up2);
>             fail("should throw NullPointerException");
>         } catch (NullPointerException e) {
>             // Expected
>         }
>     }
>     public void test_Scenario6() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[5]);
>         assertFalse(up1.equals(up2));
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656100#action_12656100 ] 

Alexey Varlamov commented on HARMONY-6043:
------------------------------------------

Looking on the test source, I'd rather consider this as non-bug difference. 
Especially, test_Scenario5 vs test_Scenario6 is a true find - do we really have to comply?

> [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-6043
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6043
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>            Assignee: Tony Wu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6043.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Given a test case[1], RI works well while HARMONY fails.
> [1] UnresolvedPermissionTest 
> public class UnresolvedPermissionTest extends TestCase {
>     public static final String type = "java.util.PropertyPermission";
>     public static final String name = "os.name";
>     public static final String action = "write,read";
>     public void test_Scenario0() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 null);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario1() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario2() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario3() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario4() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario5() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         try {
>             up1.equals(up2);
>             fail("should throw NullPointerException");
>         } catch (NullPointerException e) {
>             // Expected
>         }
>     }
>     public void test_Scenario6() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[5]);
>         assertFalse(up1.equals(up2));
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655901#action_12655901 ] 

Kevin Zhou commented on HARMONY-6043:
-------------------------------------

It seems that Harmony's behavior is different from RI.
Already make a patch attached.





> [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-6043
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6043
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>            Assignee: Tony Wu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6043.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Given a test case[1], RI works well while HARMONY fails.
> [1] UnresolvedPermissionTest 
> public class UnresolvedPermissionTest extends TestCase {
>     public static final String type = "java.util.PropertyPermission";
>     public static final String name = "os.name";
>     public static final String action = "write,read";
>     public void test_Scenario0() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 null);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario1() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario2() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario3() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario4() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario5() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         try {
>             up1.equals(up2);
>             fail("should throw NullPointerException");
>         } catch (NullPointerException e) {
>             // Expected
>         }
>     }
>     public void test_Scenario6() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[5]);
>         assertFalse(up1.equals(up2));
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655909#action_12655909 ] 

Kevin Zhou commented on HARMONY-6043:
-------------------------------------

Patch applied to r725920.

> [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-6043
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6043
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>            Assignee: Tony Wu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6043.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Given a test case[1], RI works well while HARMONY fails.
> [1] UnresolvedPermissionTest 
> public class UnresolvedPermissionTest extends TestCase {
>     public static final String type = "java.util.PropertyPermission";
>     public static final String name = "os.name";
>     public static final String action = "write,read";
>     public void test_Scenario0() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 null);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario1() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario2() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario3() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario4() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario5() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         try {
>             up1.equals(up2);
>             fail("should throw NullPointerException");
>         } catch (NullPointerException e) {
>             // Expected
>         }
>     }
>     public void test_Scenario6() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[5]);
>         assertFalse(up1.equals(up2));
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well

Posted by "Tony Wu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu resolved HARMONY-6043.
------------------------------

    Resolution: Fixed

2nd patch applied at r728589 with handling to NPE.  Thanks Kevin. Please verify if it fixes as you expected.

> [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-6043
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6043
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>            Assignee: Tony Wu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6043.diff, HARMONY-6043v2.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Given a test case[1], RI works well while HARMONY fails.
> [1] UnresolvedPermissionTest 
> public class UnresolvedPermissionTest extends TestCase {
>     public static final String type = "java.util.PropertyPermission";
>     public static final String name = "os.name";
>     public static final String action = "write,read";
>     public void test_Scenario0() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 null);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario1() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario2() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 null);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario3() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         assertEquals(up1, up2);
>     }
>     public void test_Scenario4() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[0]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         assertFalse(up1.equals(up2));
>     }
>     public void test_Scenario5() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         try {
>             up1.equals(up2);
>             fail("should throw NullPointerException");
>         } catch (NullPointerException e) {
>             // Expected
>         }
>     }
>     public void test_Scenario6() {
>         UnresolvedPermission up1 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[2]);
>         UnresolvedPermission up2 = new UnresolvedPermission(type, name, action,
>                 new java.security.cert.Certificate[5]);
>         assertFalse(up1.equals(up2));
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.