UNOMI-59 : Handle update of multivalued property
Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/a0a87f30 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/a0a87f30 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/a0a87f30 Branch: refs/heads/UNOMI-28-ES-2-X-UPGRADE Commit: a0a87f30ee765d9914d1b8b7e523880cc6a66f40 Parents: 4c20fa6 Author: Abdelkader Midani <[email protected]> Authored: Tue Oct 11 18:27:34 2016 +0200 Committer: Thomas Draier <[email protected]> Committed: Thu Oct 27 09:45:46 2016 +0200 ---------------------------------------------------------------------- .../unomi/services/services/ProfileServiceImpl.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/a0a87f30/services/src/main/java/org/apache/unomi/services/services/ProfileServiceImpl.java ---------------------------------------------------------------------- diff --git a/services/src/main/java/org/apache/unomi/services/services/ProfileServiceImpl.java b/services/src/main/java/org/apache/unomi/services/services/ProfileServiceImpl.java index 9194d16..52aef50 100644 --- a/services/src/main/java/org/apache/unomi/services/services/ProfileServiceImpl.java +++ b/services/src/main/java/org/apache/unomi/services/services/ProfileServiceImpl.java @@ -771,16 +771,8 @@ public class ProfileServiceImpl implements ProfileService, SynchronousBundleList for (Map.Entry<String, Object> newEntry : object.entrySet()) { if (newEntry.getValue() != null) { if (newEntry.getValue() instanceof Collection) { - Collection currentCollection = (Collection) target.get(newEntry.getKey()); - if (currentCollection != null) { - if (!currentCollection.containsAll((Collection) newEntry.getValue())) { - currentCollection.clear(); - changed |= currentCollection.addAll((Collection) newEntry.getValue()); - } - } else { - target.put(newEntry.getKey(), newEntry.getValue()); - changed = true; - } + target.put(newEntry.getKey(), newEntry.getValue()); + changed = true; } else if (newEntry.getValue() instanceof Map) { Map<String,Object> currentMap = (Map) target.get(newEntry.getKey()); if (currentMap == null) {
