tamaya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anat...@apache.org
Subject incubator-tamaya-extensions git commit: TAMAYA-352 Added fallback calling of other resolvers, only trying system and env props as a fallback.
Date Fri, 28 Sep 2018 03:07:16 GMT
Repository: incubator-tamaya-extensions
Updated Branches:
  refs/heads/master 1d735ca47 -> ac45f107b


TAMAYA-352 Added fallback calling of other resolvers, only trying system and env props as
a fallback.


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/ac45f107
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/tree/ac45f107
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/diff/ac45f107

Branch: refs/heads/master
Commit: ac45f107b16ee01d7aea3dc26285e93be157ff13
Parents: 1d735ca
Author: Anatole Tresch <atsticks@gmail.com>
Authored: Fri Sep 28 05:07:02 2018 +0200
Committer: Anatole Tresch <atsticks@gmail.com>
Committed: Fri Sep 28 05:07:02 2018 +0200

----------------------------------------------------------------------
 .../internal/DefaultExpressionEvaluator.java         | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/ac45f107/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/DefaultExpressionEvaluator.java
----------------------------------------------------------------------
diff --git a/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/DefaultExpressionEvaluator.java
b/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/DefaultExpressionEvaluator.java
index 20e289b..c3fe387 100644
--- a/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/DefaultExpressionEvaluator.java
+++ b/modules/resolver/src/main/java/org/apache/tamaya/resolver/internal/DefaultExpressionEvaluator.java
@@ -230,17 +230,12 @@ public class DefaultExpressionEvaluator implements ExpressionEvaluator
{
                 break;
             }
         }
+        // Lookup system and environment props as defaults...
         if(value==null){
-            for(ExpressionResolver resolver:resolvers){
-                try{
-                    value = resolver.evaluate(unresolvedExpression);
-                    if(value!=null){
-                        return value;
-                    }
-                }catch(Exception e){
-                    LOG.log(Level.FINEST, "Error during expression resolution from " + resolver,
e);
-                }
-            }
+            value = System.getProperty(unresolvedExpression);
+        }
+        if(value==null){
+            value = System.getenv(unresolvedExpression);
         }
         if(value==null){
             LOG.log(Level.WARNING, "Unresolvable expression encountered " + unresolvedExpression);


Mime
View raw message