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

Artem Smotrakov artem.smotrakov at oracle.com
Thu Jun 25 10:56:52 UTC 2015


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