tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ple...@apache.org
Subject incubator-tamaya git commit: TAMAYA-13 Fixed first bug found by FindBugs.
Date Sun, 30 Nov 2014 15:46:42 GMT
Repository: incubator-tamaya
Updated Branches:
  refs/heads/master 71ef93d23 -> f8f7aad5f


TAMAYA-13 Fixed first bug found by FindBugs.


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

Branch: refs/heads/master
Commit: f8f7aad5fafa1d7f442012aded5eb53c5c8403e9
Parents: 71ef93d
Author: Oliver B. Fischer <plexus@apache.org>
Authored: Sun Nov 30 16:46:19 2014 +0100
Committer: Oliver B. Fischer <plexus@apache.org>
Committed: Sun Nov 30 16:46:19 2014 +0100

----------------------------------------------------------------------
 api/src/main/java/org/apache/tamaya/ConfigChangeSetBuilder.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/f8f7aad5/api/src/main/java/org/apache/tamaya/ConfigChangeSetBuilder.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/tamaya/ConfigChangeSetBuilder.java b/api/src/main/java/org/apache/tamaya/ConfigChangeSetBuilder.java
index bc695dd..be6b906 100644
--- a/api/src/main/java/org/apache/tamaya/ConfigChangeSetBuilder.java
+++ b/api/src/main/java/org/apache/tamaya/ConfigChangeSetBuilder.java
@@ -299,6 +299,7 @@ public final class ConfigChangeSetBuilder {
      */
     public static Collection<PropertyChangeEvent> compare(PropertyProvider map1, PropertyProvider
map2) {
         List<PropertyChangeEvent> changes = new ArrayList<>();
+
         for (Map.Entry<String, String> en : map1.toMap().entrySet()) {
             Optional<String> val = map2.get(en.getKey());
             if(!val.isPresent()) {
@@ -308,12 +309,13 @@ public final class ConfigChangeSetBuilder {
                 changes.add(new PropertyChangeEvent(map1, en.getKey(), val.get(), en.getValue()));
             }
         }
+
         for (Map.Entry<String, String> en : map2.toMap().entrySet()) {
             Optional<String> val = map1.get(en.getKey());
             if(!val.isPresent()) {
                 changes.add(new PropertyChangeEvent(map1, en.getKey(), null, en.getValue()));
             }
-            else if(!val.equals(en.getValue())){
+            else if(!val.equals(Optional.ofNullable(en.getValue()))) {
                 changes.add(new PropertyChangeEvent(map1, en.getKey(), val.get(), en.getValue()));
             }
         }


Mime
View raw message