Commit 07919d4443f741f1a7b5fd374c04164cb3ef5356
1 parent
6eb182ad
Exists in
master
Alteração no tratamento para chaves com valor vazio no arquivo de
configuração
Showing
2 changed files
with
2 additions
and
15 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/ConfigurationPrimitiveOrWrapperValueExtractor.java
| ... | ... | @@ -78,19 +78,12 @@ public class ConfigurationPrimitiveOrWrapperValueExtractor implements Configurat |
| 78 | 78 | + key); |
| 79 | 79 | |
| 80 | 80 | } catch (ConversionException cause) { |
| 81 | - validate(prefix, key, configuration, cause); | |
| 82 | - value = null; | |
| 81 | + throw cause; | |
| 83 | 82 | } |
| 84 | 83 | |
| 85 | 84 | return value; |
| 86 | 85 | } |
| 87 | 86 | |
| 88 | - private void validate(String prefix, String key, Configuration configuration, ConversionException cause) { | |
| 89 | - if (!Strings.isEmpty(configuration.getString(prefix + key))) { | |
| 90 | - throw cause; | |
| 91 | - } | |
| 92 | - } | |
| 93 | - | |
| 94 | 87 | @Override |
| 95 | 88 | public boolean isSupported(Field field) { |
| 96 | 89 | return field.getType().isPrimitive() || wrappers.contains(field.getType()); | ... | ... |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/ConfigurationStringValueExtractor.java
| ... | ... | @@ -51,13 +51,7 @@ public class ConfigurationStringValueExtractor implements ConfigurationValueExtr |
| 51 | 51 | |
| 52 | 52 | @Override |
| 53 | 53 | public Object getValue(String prefix, String key, Field field, Configuration configuration) throws Exception { |
| 54 | - String value = configuration.getString(prefix + key); | |
| 55 | - | |
| 56 | - if (Strings.isEmpty(value)) { | |
| 57 | - value = null; | |
| 58 | - } | |
| 59 | - | |
| 60 | - return value; | |
| 54 | + return configuration.getString(prefix + key); | |
| 61 | 55 | } |
| 62 | 56 | |
| 63 | 57 | @Override | ... | ... |