tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ple...@apache.org
Subject [20/50] [abbrv] incubator-tamaya-extensions git commit: TAMAYA-145: Fixed NPE on cascaded filters and mappings.
Date Fri, 16 Sep 2016 22:03:30 GMT
TAMAYA-145: Fixed NPE on cascaded filters and mappings.


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

Branch: refs/heads/master
Commit: 74f3aa4693161ef170870f6959ac5bab74daf976
Parents: 39de6f8
Author: anatole <anatole@apache.org>
Authored: Wed May 11 03:43:22 2016 +0200
Committer: anatole <anatole@apache.org>
Committed: Wed May 11 03:43:22 2016 +0200

----------------------------------------------------------------------
 .../org/apache/tamaya/functions/ConfigurationFunctions.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/74f3aa46/functions/src/main/java/org/apache/tamaya/functions/ConfigurationFunctions.java
----------------------------------------------------------------------
diff --git a/functions/src/main/java/org/apache/tamaya/functions/ConfigurationFunctions.java
b/functions/src/main/java/org/apache/tamaya/functions/ConfigurationFunctions.java
index 3b63d8d..6dd0427 100644
--- a/functions/src/main/java/org/apache/tamaya/functions/ConfigurationFunctions.java
+++ b/functions/src/main/java/org/apache/tamaya/functions/ConfigurationFunctions.java
@@ -232,7 +232,10 @@ public final class ConfigurationFunctions {
                     return new MappedConfiguration(filtered, new KeyMapper(){
                         @Override
                         public String mapKey(String key) {
-                            return key.substring(areaKey.length());
+                            if(key.startsWith(areaKey)) {
+                                return key.substring(areaKey.length());
+                            }
+                            return null;
                         }
                     }, "stripped");
                 }
@@ -249,7 +252,7 @@ public final class ConfigurationFunctions {
      * @return true, if the entry is exact in this section
      */
     public static boolean isKeyInSection(String key, String sectionKey) {
-        return sectionKey.isEmpty() || key.startsWith(sectionKey);
+        return key.startsWith(sectionKey);
     }
 
     /**


Mime
View raw message