You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by am...@apache.org on 2017/07/25 15:24:14 UTC

incubator-unomi git commit: UNOMI-101 : Class Cast Exception when merging property is not a text

Repository: incubator-unomi
Updated Branches:
  refs/heads/master a635d19cc -> 4e49d5c4f


UNOMI-101 : Class Cast Exception when merging property is not a text


Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/4e49d5c4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/4e49d5c4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/4e49d5c4

Branch: refs/heads/master
Commit: 4e49d5c4ff11d794cb00b8f16757ac724e32bbf6
Parents: a635d19
Author: Abdelkader Midani <am...@apache.org>
Authored: Tue Jul 25 17:23:54 2017 +0200
Committer: Abdelkader Midani <am...@apache.org>
Committed: Tue Jul 25 17:24:07 2017 +0200

----------------------------------------------------------------------
 .../apache/unomi/router/services/ProfileImportServiceImpl.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/4e49d5c4/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java
----------------------------------------------------------------------
diff --git a/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java b/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java
index dd322c3..63cfc56 100644
--- a/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java
+++ b/extensions/router/router-service/src/main/java/org/apache/unomi/router/services/ProfileImportServiceImpl.java
@@ -36,7 +36,7 @@ public class ProfileImportServiceImpl extends AbstractCustomServiceImpl implemen
     public boolean saveMergeDeleteImportedProfile(ProfileToImport profileToImport) throws InvocationTargetException, IllegalAccessException {
         logger.debug("Importing profile with ID : {}", profileToImport.getItemId());
         Profile existingProfile = new Profile();
-        List<Profile> existingProfiles = persistenceService.query("properties." + profileToImport.getMergingProperty(), (String) profileToImport.getProperties().get(profileToImport.getMergingProperty()), null, Profile.class);
+        List<Profile> existingProfiles = persistenceService.query("properties." + profileToImport.getMergingProperty(), profileToImport.getProperties().get(profileToImport.getMergingProperty()).toString(), null, Profile.class);
         logger.debug("Query existing profile with mergingProperty: {}. Found: {}", profileToImport.getMergingProperty(), existingProfiles.size());
 
         //Profile already exist, and import config allow to overwrite profiles
@@ -65,7 +65,7 @@ public class ProfileImportServiceImpl extends AbstractCustomServiceImpl implemen
             BeanUtils.copyProperties(existingProfile, profileToImport);
         } else {
             logger.warn("{} occurences found for profile with {} = {}. Profile import is skipped", existingProfiles.size(),
-                    profileToImport.getMergingProperty(), profileToImport.getProperties().get(profileToImport.getMergingProperty()));
+                    profileToImport.getMergingProperty(), profileToImport.getProperties().get(profileToImport.getMergingProperty()).toString());
         }
         logger.debug("-------------------------------------");
         return persistenceService.save(existingProfile, true);