TAMAYA-163: Prevent the extension registering a ConverterBean without types.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/commit/d069c62e
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/tree/d069c62e
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/diff/d069c62e

Branch: refs/heads/master
Commit: d069c62ee2ff667a9ffd430da8e1cad3adc6f394
Parents: cc1b41b
Author: anatole <anat...@apache.org>
Authored: Fri Jun 3 11:30:10 2016 +0200
Committer: anatole <anat...@apache.org>
Committed: Fri Jun 3 11:30:25 2016 +0200

----------------------------------------------------------------------
 .../apache/tamaya/integration/cdi/ConfigurationExtension.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya-extensions/blob/d069c62e/integration/cdi/src/main/java/org/apache/tamaya/integration/cdi/ConfigurationExtension.java
----------------------------------------------------------------------
diff --git 
a/integration/cdi/src/main/java/org/apache/tamaya/integration/cdi/ConfigurationExtension.java
 
b/integration/cdi/src/main/java/org/apache/tamaya/integration/cdi/ConfigurationExtension.java
index a6fee37..376836d 100644
--- 
a/integration/cdi/src/main/java/org/apache/tamaya/integration/cdi/ConfigurationExtension.java
+++ 
b/integration/cdi/src/main/java/org/apache/tamaya/integration/cdi/ConfigurationExtension.java
@@ -130,7 +130,9 @@ public class ConfigurationExtension implements Extension {
     }
 
     public void addConverter(@Observes final AfterBeanDiscovery abd, final 
BeanManager bm) {
-        abd.addBean(new ConverterBean(convBean, types));
+        if(!types.isEmpty()) {
+            abd.addBean(new ConverterBean(convBean, types));
+        }
     }
 
     private void tryLoadOpererator(Class<? extends ConfigOperator> 
operatorClass) {

Reply via email to