Commit 1f86a4a82adc32b858f0d4aa34b477f2aca5cbd7
1 parent
ec0ad539
Exists in
master
Inclusão de comentários TODO para lançar log WARN em funcionalidades
depreciadas do ConfigurationLoader.
Showing
1 changed file
with
14 additions
and
6 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/configuration/ConfigurationLoader.java
| ... | ... | @@ -82,9 +82,9 @@ public class ConfigurationLoader implements Serializable { |
| 82 | 82 | private ResourceBundle bundle; |
| 83 | 83 | |
| 84 | 84 | private Logger logger; |
| 85 | - | |
| 85 | + | |
| 86 | 86 | private CoreBootstrap bootstrap; |
| 87 | - | |
| 87 | + | |
| 88 | 88 | /** |
| 89 | 89 | * Loads a config class filling it with the corresponding values. |
| 90 | 90 | * |
| ... | ... | @@ -159,6 +159,10 @@ public class ConfigurationLoader implements Serializable { |
| 159 | 159 | |
| 160 | 160 | Configuration classAnnotation = type.getAnnotation(Configuration.class); |
| 161 | 161 | if (!Strings.isEmpty(classAnnotation.prefix())) { |
| 162 | + | |
| 163 | + // TODO Verificar se o prefixo foi informado sem o ponto. Se sim, emitir um log do tipo WARN avisando para o | |
| 164 | + // usuário corrigir manualmente e colocar o ponto automaticamente para evitar quebra de compatibilidade. | |
| 165 | + | |
| 162 | 166 | prefix = classAnnotation.prefix() + "."; |
| 163 | 167 | } |
| 164 | 168 | |
| ... | ... | @@ -196,6 +200,10 @@ public class ConfigurationLoader implements Serializable { |
| 196 | 200 | } |
| 197 | 201 | } |
| 198 | 202 | |
| 203 | + // TODO Se a variável key estiver diferente de field.getName() neste ponto, emitir um log WARN avisando que o | |
| 204 | + // formato encontrado em key deve ser definido manualmente utilizando a anotação @Name no atributo | |
| 205 | + // correspondente da classe de configuração do usuário. | |
| 206 | + | |
| 199 | 207 | if (matches == 0) { |
| 200 | 208 | getLogger().debug(getBundle().getString("configuration-key-not-found", key, conventions)); |
| 201 | 209 | } else if (matches > 1) { |
| ... | ... | @@ -445,12 +453,12 @@ public class ConfigurationLoader implements Serializable { |
| 445 | 453 | |
| 446 | 454 | return logger; |
| 447 | 455 | } |
| 448 | - | |
| 449 | - private CoreBootstrap getBootstrap(){ | |
| 450 | - if (bootstrap == null){ | |
| 456 | + | |
| 457 | + private CoreBootstrap getBootstrap() { | |
| 458 | + if (bootstrap == null) { | |
| 451 | 459 | bootstrap = Beans.getReference(CoreBootstrap.class); |
| 452 | 460 | } |
| 453 | - | |
| 461 | + | |
| 454 | 462 | return bootstrap; |
| 455 | 463 | } |
| 456 | 464 | } | ... | ... |