harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov (JIRA)" <j...@apache.org>
Subject [jira] Reopened: (HARMONY-6043) [classlib] [security] UnresolvedPermission.equals(Object) doesn't works well
Date Fri, 12 Dec 2008 18:29:44 GMT

     [ 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.


Mime
View raw message