geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johndam...@apache.org
Subject svn commit: r1805168 - in /geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config: ConfigImpl.java configsource/SystemEnvConfigSource.java
Date Wed, 16 Aug 2017 10:29:14 GMT
Author: johndament
Date: Wed Aug 16 10:29:14 2017
New Revision: 1805168

URL: http://svn.apache.org/viewvc?rev=1805168&view=rev
Log:
Differentiate the results of empty strings and null values.  Empty strings mean the property
is set, but empty, null means the property is not set.

Modified:
    geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/ConfigImpl.java
    geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/configsource/SystemEnvConfigSource.java

Modified: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/ConfigImpl.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/ConfigImpl.java?rev=1805168&r1=1805167&r2=1805168&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/ConfigImpl.java
(original)
+++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/ConfigImpl.java
Wed Aug 16 10:29:14 2017
@@ -116,7 +116,7 @@ public class ConfigImpl implements Confi
     @Override
     public <T> T getValue(String propertyName, Class<T> propertyType) {
         String value = getValue(propertyName);
-        if (value == null || value.isEmpty()) {
+        if (value == null) {
             throw new NoSuchElementException("No configured value found for config key "
+ propertyName);
         }
 
@@ -219,13 +219,9 @@ public class ConfigImpl implements Confi
     }
 
 
-    protected List<ConfigSource> sortDescending(List<ConfigSource> configSources)
{
-        Collections.sort(configSources, new Comparator<ConfigSource>() {
-            @Override
-            public int compare(ConfigSource configSource1, ConfigSource configSource2) {
-                return (configSource1.getOrdinal() > configSource2.getOrdinal()) ? -1
: 1;
-            }
-        });
+    private List<ConfigSource> sortDescending(List<ConfigSource> configSources)
{
+        configSources.sort(
+                (configSource1, configSource2) -> (configSource1.getOrdinal() > configSource2.getOrdinal())
? -1 : 1);
         return configSources;
 
     }

Modified: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/configsource/SystemEnvConfigSource.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/configsource/SystemEnvConfigSource.java?rev=1805168&r1=1805167&r2=1805168&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/configsource/SystemEnvConfigSource.java
(original)
+++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/configsource/SystemEnvConfigSource.java
Wed Aug 16 10:29:14 2017
@@ -57,7 +57,7 @@ public class SystemEnvConfigSource exten
     @Override
     public String getValue(String key) {
         String val = configValues.get(key);
-        if (val == null || val.isEmpty()) {
+        if (val == null) {
             val = configValues.get(key.replace('.', '_'));
         }
 



Mime
View raw message