8297074: Use enhanced-for cycle instead of Enumeration in javax.crypto

Reviewed-by: weijun, wetmore
This commit is contained in:
Andrey Turbanov 2022-11-17 20:25:53 +00:00
parent 819af69f40
commit 66228f77fe
3 changed files with 6 additions and 36 deletions

View file

@ -229,10 +229,7 @@ implements Serializable {
// For each algorithm in this CryptoPermissions,
// find out if there is anything we should add into
// ret.
Enumeration<String> thisKeys = this.perms.keys();
while (thisKeys.hasMoreElements()) {
String alg = thisKeys.nextElement();
for (String alg : this.perms.keySet()) {
PermissionCollection thisPc = this.perms.get(alg);
PermissionCollection thatPc = other.perms.get(alg);
@ -270,9 +267,7 @@ implements Serializable {
maxKeySize =
((CryptoPermission)
thisWildcard.elements().nextElement()).getMaxKeySize();
Enumeration<String> thatKeys = other.perms.keys();
while (thatKeys.hasMoreElements()) {
String alg = thatKeys.nextElement();
for (String alg : other.perms.keySet()) {
if (this.perms.containsKey(alg)) {
continue;