tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject incubator-tamaya git commit: TAMAYA-260: Added on/off on Boolean conversion. Fixed minor issue in value evaluation.
Date Sun, 13 Aug 2017 23:39:49 GMT
Repository: incubator-tamaya
Updated Branches:
  refs/heads/java8 57211635f -> 78182381a


TAMAYA-260: Added on/off on Boolean conversion.
Fixed minor issue in value evaluation.


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

Branch: refs/heads/java8
Commit: 78182381aaedbe151c9c33a01918d19a548538fe
Parents: 5721163
Author: anatole <anatole@apache.org>
Authored: Mon Aug 14 01:39:43 2017 +0200
Committer: anatole <anatole@apache.org>
Committed: Mon Aug 14 01:39:43 2017 +0200

----------------------------------------------------------------------
 .../apache/tamaya/core/internal/DefaultConfigValueEvaluator.java   | 2 +-
 .../java/org/apache/tamaya/core/internal/DefaultConfiguration.java | 2 +-
 .../apache/tamaya/core/internal/converters/BooleanConverter.java   | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/78182381/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigValueEvaluator.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigValueEvaluator.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigValueEvaluator.java
index f3b30a3..332df89 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigValueEvaluator.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigValueEvaluator.java
@@ -42,7 +42,7 @@ public class DefaultConfigValueEvaluator implements ConfigValueEvaluator{
                     collect(unfilteredValue, key, propertySource);
         }
         if(unfilteredValue==null || unfilteredValue.getValue()==null){
-            return unfilteredValue;
+            return null;
         }
         return unfilteredValue;
     }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/78182381/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfiguration.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfiguration.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfiguration.java
index 54cd186..c768a4c 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfiguration.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfiguration.java
@@ -81,7 +81,7 @@ public class DefaultConfiguration implements Configuration {
         Objects.requireNonNull(key, "Key must not be null.");
 
         PropertyValue value = configEvaluator.evaluteRawValue(key, configurationContext);
-        if(value==null || value.getValue()==null){
+        if(value==null){
             return null;
         }
         value = PropertyFiltering.applyFilter(value, configurationContext);

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/78182381/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
index 61c182b..0d14fc1 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/BooleanConverter.java
@@ -44,12 +44,14 @@ public class BooleanConverter implements PropertyConverter<Boolean>
{
             case "y":
             case "true":
             case "t":
+            case "on":
                 return Boolean.TRUE;
             case "no":
             case "n":
             case "false":
             case "f":
             case "0":
+            case "off":
                 return Boolean.FALSE;
             default:
                 LOG.finest("Unknown boolean value encountered: " + value);


Mime
View raw message