Repository: incubator-tamaya
Updated Branches:
  refs/heads/master 8722e5bba -> ab914033a


TAMAYA-340: Use constants across whole class


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

Branch: refs/heads/master
Commit: f33d454605f4ea41a01faef4774c037a6a391887
Parents: 8722e5b
Author: Phil Ottlinger <pottlin...@apache.org>
Authored: Tue Jun 5 21:49:37 2018 +0200
Committer: Phil Ottlinger <pottlin...@apache.org>
Committed: Tue Jun 5 21:49:37 2018 +0200

----------------------------------------------------------------------
 .../propertysource/EnvironmentPropertySource.java   | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/f33d4546/code/spi-support/src/main/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.java
----------------------------------------------------------------------
diff --git 
a/code/spi-support/src/main/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.java
 
b/code/spi-support/src/main/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.java
index 40e6c45..ac01586 100644
--- 
a/code/spi-support/src/main/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.java
+++ 
b/code/spi-support/src/main/java/org/apache/tamaya/spisupport/propertysource/EnvironmentPropertySource.java
@@ -85,7 +85,7 @@ import java.util.Map;
  * <h1>Disabling the access to environment variables</h1>
  *
  * <p>The access to environment variables can simply be
- * disabled by setting the systemproperty {@code tamaya.envprops.disable}
+ * disabled by setting the system property {@code tamaya.envprops.disable}
  * or {@code tamaya.defaults.disable} to {@code true}.</p>
  */
 public class EnvironmentPropertySource extends BasePropertySource {
@@ -133,19 +133,19 @@ public class EnvironmentPropertySource extends 
BasePropertySource {
      * </pre>
      */
     private void initFromSystemProperties() {
-        String value = System.getProperty("tamaya.envprops.prefix");
+        String value = System.getProperty(TAMAYA_ENVPROPS_PREFIX);
         if(value==null){
-            prefix = System.getenv("tamaya.envprops.prefix");
+            prefix = System.getenv(TAMAYA_ENVPROPS_PREFIX);
         }
-        value = System.getProperty("tamaya.envprops.disable");
+        value = System.getProperty(TAMAYA_ENVPROPS_DISABLE);
         if(value==null){
-            value = System.getenv("tamaya.envprops.disable");
+            value = System.getenv(TAMAYA_ENVPROPS_DISABLE);
         }
         if(value==null){
-            value = System.getProperty("tamaya.defaults.disable");
+            value = System.getProperty(TAMAYA_DEFAULT_DISABLE);
         }
         if(value==null){
-            value = System.getenv("tamaya.defaults.disable");
+            value = System.getenv(TAMAYA_DEFAULT_DISABLE);
         }
         if(value!=null && !value.isEmpty()) {
             this.disabled = Boolean.parseBoolean(value);
@@ -214,7 +214,7 @@ public class EnvironmentPropertySource extends 
BasePropertySource {
     }
 
     private boolean hasPrefix() {
-        return null != prefix;
+        return null != prefix && prefix.isEmpty();
     }
 
     @Override

Reply via email to