[9] RFR: 8129575: Equal DelegationPermission instances may return different hash codes

Weijun Wang weijun.wang at oracle.com
Thu Jun 25 12:16:37 UTC 2015


Good.

Do you need me pushing it for you?

--Max

On 06/25/2015 07:33 PM, Artem Smotrakov wrote:
> Sure, http://cr.openjdk.java.net/~asmotrak/delegation_permission/webrev.02/
>
> Artem
>
> On 06/25/2015 02:14 PM, Sean Mullan wrote:
>> Looks good. There is an incorrect period at the end of line 152, can
>> you also remove that?
>>
>> Thanks,
>> Sean
>>
>> On 06/25/2015 06:56 AM, Artem Smotrakov wrote:
>>> Hello,
>>>
>>> Please review this fix for 9.
>>>
>>> A string which contains a number of principals can be passed to
>>> constructor of DelegationPermission. The class parses this string, and
>>> extracts principals. But hashCode() method in DelegationPermission uses
>>> Permission.getName() to calculate a hash. Permission.getName() method
>>> returns the original string which was passed to constructor. As a
>>> result, semantically equal instances of DelegationPermission may return
>>> different hash codes.
>>>
>>> Changes:
>>> - updated hashCode() method
>>> - re-factored equals() and implies() method
>>> - removed some unused and commented code in DelegationPermission class
>>> - added a test
>>>
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8129575
>>> Webrev:
>>> http://cr.openjdk.java.net/~asmotrak/delegation_permission/webrev.01/
>>>
>>> Artem
>



More information about the security-dev mailing list