Skip to content

Commit

Permalink
JCR-2929 - Various places do map lookups in loop instead of using ent…
Browse files Browse the repository at this point in the history
…rySet iterator (reverting changes made by dave brosius)

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1084912 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
anchela committed Mar 24, 2011
1 parent f8686fe commit a8ede6a
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ protected AccessControlEntryImpl(Principal principal, Privilege[] privileges,
} else {
this.restrictions = new HashMap<Name, Value>(restrictions.size());
// validate the passed restrictions and fill the map
for (Map.Entry<String, Value> entry : restrictions.entrySet()) {
Value value = ValueHelper.copy(entry.getValue(), getValueFactory());
this.restrictions.put(getResolver().getQName(entry.getKey()), value);
for (String name : restrictions.keySet()) {
Value value = ValueHelper.copy(restrictions.get(name), getValueFactory());
this.restrictions.put(getResolver().getQName(name), value);
}
}
}
Expand All @@ -148,8 +148,7 @@ protected AccessControlEntryImpl(AccessControlEntryImpl base, Privilege[] privil
if (!base.restrictions.isEmpty()) {
// validate the passed restrictions and fill the map
for (Name name : base.restrictions.keySet()) {
Value value = base.restrictions.get(name);
value = ValueHelper.copy(value, getValueFactory());
Value value = ValueHelper.copy(base.restrictions.get(name), getValueFactory());
this.restrictions.put(name, value);
}
}
Expand Down

0 comments on commit a8ede6a

Please sign in to comment.