diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigComponentImpl.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigComponentImpl.java index 3a916d58b4..079e5944a9 100644 --- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigComponentImpl.java +++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/RMCaveatConfigComponentImpl.java @@ -1022,13 +1022,12 @@ public class RMCaveatConfigComponentImpl implements ContentServicePolicies.OnCon for (String listName : listNames) { Map> members = config.get(listName); - - Set authorityNames = members.keySet(); JSONObject listMembers = new JSONObject(); - for (String authorityName : authorityNames) + for (Map.Entry> member : members.entrySet()) { - List authorities = members.get(authorityName); + final String authorityName = member.getKey(); + final List authorities = member.getValue(); try { listMembers.put(authorityName, authorities); diff --git a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptConstraint.java b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptConstraint.java index bfcdd2ff18..375068fd17 100644 --- a/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptConstraint.java +++ b/rm-community/rm-community-repo/source/compatibility/org/alfresco/module/org_alfresco_module_rm/caveat/ScriptConstraint.java @@ -97,15 +97,12 @@ public class ScriptConstraint implements Serializable return new ScriptConstraintAuthority[0]; } - // Here with some data to return - Set authorities = values.keySet(); - ArrayList constraints = new ArrayList<>(values.size()); - for(String authority : authorities) + for (Map.Entry> entry : values.entrySet()) { ScriptConstraintAuthority constraint = new ScriptConstraintAuthority(); - constraint.setAuthorityName(authority); - constraint.setValues(values.get(authority)); + constraint.setAuthorityName(entry.getKey()); + constraint.setValues(entry.getValue()); constraints.add(constraint); } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditEntry.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditEntry.java index 8b8c59362f..073a1a4ebb 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditEntry.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditEntry.java @@ -255,22 +255,23 @@ public final class RecordsManagementAuditEntry this.beforeProperties.size() + this.afterProperties.size()); // add all the properties present before the audited action - for (QName valuePropName : this.beforeProperties.keySet()) + for (Map.Entry entry : this.beforeProperties.entrySet()) { + final QName valuePropName = entry.getKey(); Pair values = new Pair<>( - this.beforeProperties.get(valuePropName), + entry.getValue(), this.afterProperties.get(valuePropName)); this.changedProperties.put(valuePropName, values); } // add all the properties present after the audited action that // have not already been added - for (QName valuePropName : this.afterProperties.keySet()) + for (Map.Entry entry : this.afterProperties.entrySet()) { + final QName valuePropName = entry.getKey(); if (!this.beforeProperties.containsKey(valuePropName)) { - Pair values = new Pair<>(null, - this.afterProperties.get(valuePropName)); + Pair values = new Pair<>(null, entry.getValue()); this.changedProperties.put(valuePropName, values); } }