You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2016/11/14 16:25:52 UTC

[30/38] incubator-unomi git commit: UNOMI-59 : Handle update of multivalued property

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/b311e198
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/b311e198
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/b311e198

Branch: refs/heads/UNOMI-28-ES-2-X-UPGRADE
Commit: b311e19886ceb0277c45c48319b94256d60ed3eb
Parents: b8cf1c6
Author: Abdelkader Midani <am...@jahia.com>
Authored: Tue Oct 11 18:27:34 2016 +0200
Committer: Abdelkader Midani <am...@jahia.com>
Committed: Mon Oct 24 16:19:29 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/b311e198/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) {