[9] RFR: 8129575: Equal DelegationPermission instances may return different hash codes
Sean Mullan
sean.mullan at oracle.com
Thu Jun 25 11:14:45 UTC 2015
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