Bug in com.xerox.amazonaws.sdb.Domain cache handling

3 views
Skip to first unread message

adamwtw

unread,
Sep 10, 2010, 10:47:32 AM9/10/10
to typica
In com.xerox.amazonaws.sdb.Domain, replaceAttributes method (line
285), the cache is updated in a wrong way. Only the attributes from
the old map, that are not present in the new attributes map, should be
copied over, so instead of:

attrs.putAll(old.getAttributes());

It should be:

// merge cached attrs; only putting if absent
for (Map.Entry<String, Set<String>> oldAttributesEntry :
old.getAttributes().entrySet()) {
if (!attrs.containsKey(oldAttributesEntry.getKey())) {
attrs.put(oldAttributesEntry.getKey(),
oldAttributesEntry.getValue());
}
}

Adam
Reply all
Reply to author
Forward
0 new messages