Commit 6878b525788655af61bae2da3acc258d2eda14f4
1 parent
89476e5f
Exists in
master
Tratamento para chaves sem valor
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/ConfigurationMapValueExtractor.java
@@ -49,6 +49,7 @@ import org.apache.commons.configuration.Configuration; | @@ -49,6 +49,7 @@ import org.apache.commons.configuration.Configuration; | ||
49 | 49 | ||
50 | import br.gov.frameworkdemoiselle.annotation.Priority; | 50 | import br.gov.frameworkdemoiselle.annotation.Priority; |
51 | import br.gov.frameworkdemoiselle.configuration.ConfigurationValueExtractor; | 51 | import br.gov.frameworkdemoiselle.configuration.ConfigurationValueExtractor; |
52 | +import br.gov.frameworkdemoiselle.util.Strings; | ||
52 | 53 | ||
53 | @Priority(EXTENSIONS_L1_PRIORITY) | 54 | @Priority(EXTENSIONS_L1_PRIORITY) |
54 | public class ConfigurationMapValueExtractor implements ConfigurationValueExtractor { | 55 | public class ConfigurationMapValueExtractor implements ConfigurationValueExtractor { |
@@ -73,7 +74,10 @@ public class ConfigurationMapValueExtractor implements ConfigurationValueExtract | @@ -73,7 +74,10 @@ public class ConfigurationMapValueExtractor implements ConfigurationValueExtract | ||
73 | } | 74 | } |
74 | 75 | ||
75 | String mapKey = matcher.group(3) == null ? "default" : matcher.group(3); | 76 | String mapKey = matcher.group(3) == null ? "default" : matcher.group(3); |
76 | - value.put(mapKey, configuration.getString(confKey)); | 77 | + Object mapValue = configuration.getString(confKey); |
78 | + if (!Strings.isEmpty((String) mapValue)){ | ||
79 | + value.put(mapKey, mapValue); | ||
80 | + } | ||
77 | } | 81 | } |
78 | } | 82 | } |
79 | 83 |