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 2019/07/16 15:49:12 UTC

[unomi] branch master updated (3c2ada2 -> fd0edbb)

This is an automated email from the ASF dual-hosted git repository.

shuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git.


    from 3c2ada2  [UNOMI-236] Add a profile for OWASP maven plugin
     new d45d757  Fix for Jira UNOMI-238
     new fd0edbb  Fixed NPE handling for newEntry.getValue

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/unomi/services/services/ProfileServiceImpl.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


[unomi] 02/02: Fixed NPE handling for newEntry.getValue

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit fd0edbb352c42434e3c376678cc0d73bfab09038
Author: Michele Riva <ma...@micheleriva.it>
AuthorDate: Fri Jul 12 12:09:25 2019 +0200

    Fixed NPE handling for newEntry.getValue
---
 .../java/org/apache/unomi/services/services/ProfileServiceImpl.java   | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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 2df09bd..e612e15 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
@@ -997,10 +997,8 @@ public class ProfileServiceImpl implements ProfileService, SynchronousBundleList
     private boolean merge(Map<String, Object> target, Map<String, Object> object) {
         boolean changed = false;
         for (Map.Entry<String, Object> newEntry : object.entrySet()) {
-
-            String packageName = newEntry.getValue().getClass().getPackage().getName();
-
             if (newEntry.getValue() != null) {
+                String packageName = newEntry.getValue().getClass().getPackage().getName();
                 if (newEntry.getValue() instanceof Collection) {
                     target.put(newEntry.getKey(), newEntry.getValue());
                     changed = true;


[unomi] 01/02: Fix for Jira UNOMI-238

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit d45d757f60cd552e2bf3afe7173bbaa26c8df2ad
Author: Michele Riva <ma...@micheleriva.it>
AuthorDate: Fri Jul 12 11:27:13 2019 +0200

    Fix for Jira UNOMI-238
---
 .../java/org/apache/unomi/services/services/ProfileServiceImpl.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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 0300d46..2df09bd 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
@@ -997,6 +997,9 @@ public class ProfileServiceImpl implements ProfileService, SynchronousBundleList
     private boolean merge(Map<String, Object> target, Map<String, Object> object) {
         boolean changed = false;
         for (Map.Entry<String, Object> newEntry : object.entrySet()) {
+
+            String packageName = newEntry.getValue().getClass().getPackage().getName();
+
             if (newEntry.getValue() != null) {
                 if (newEntry.getValue() instanceof Collection) {
                     target.put(newEntry.getKey(), newEntry.getValue());
@@ -1009,7 +1012,8 @@ public class ProfileServiceImpl implements ProfileService, SynchronousBundleList
                     } else {
                         changed |= merge(currentMap, (Map) newEntry.getValue());
                     }
-                } else if (newEntry.getValue().getClass().getPackage().getName().equals("java.lang")) {
+                } else if (StringUtils.equals(packageName, "java.lang")
+                        || StringUtils.equals(packageName, "org.apache.unomi.api")) {
                     if (newEntry.getValue() != null && !newEntry.getValue().equals(target.get(newEntry.getKey()))) {
                         target.put(newEntry.getKey(), newEntry.getValue());
                         changed = true;