geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johndam...@apache.org
Subject svn commit: r1800715 - /geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java
Date Mon, 03 Jul 2017 21:51:02 GMT
Author: johndament
Date: Mon Jul  3 21:51:01 2017
New Revision: 1800715

URL: http://svn.apache.org/viewvc?rev=1800715&view=rev
Log:
GERONIMO-6566 TCK Check - if a property is configured with the default defaultValue then it
should not be considered as having a default value.

TCK Assertions: WrongConverterOnInstanceInjectionTest, MissingValueOnInstanceInjectionTest

Modified:
    geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java

Modified: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java?rev=1800715&r1=1800714&r2=1800715&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java
(original)
+++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java
Mon Jul  3 21:51:01 2017
@@ -44,7 +44,7 @@ import org.eclipse.microprofile.config.i
  * @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
  */
 public class ConfigExtension implements Extension {
-
+    private static final String DEFAULT_UNCONFIGURED_VALUE = "org.eclipse.microprofile.config.configproperty.unconfigureddvalue";
     private Config config;
 
     private Set<InjectionPoint> injectionPoints = new HashSet<>();
@@ -81,7 +81,8 @@ public class ConfigExtension implements
                 // a direct injection of a ConfigProperty
                 // that means a Converter must exist.
                 String key = ConfigInjectionBean.getConfigKey(injectionPoint, configProperty);
-                if ((configProperty.defaultValue() == null || configProperty.defaultValue().length()
== 0)
+                if ((configProperty.defaultValue() == null || configProperty.defaultValue().length()
== 0
+                        || configProperty.defaultValue().equals(DEFAULT_UNCONFIGURED_VALUE))
                         && !config.getOptionalValue(key, (Class) type).isPresent())
{
                     deploymentProblems.add("No Config Value exists for " + key);
                 }



Mime
View raw message