openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1797820 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: configurator/BeanAttributesConfiguratorImpl.java util/WebBeansUtil.java
Date Tue, 06 Jun 2017 20:11:57 GMT
Author: struberg
Date: Tue Jun  6 20:11:57 2017
New Revision: 1797820

URL: http://svn.apache.org/viewvc?rev=1797820&view=rev
Log:
OWB-1187 finish BeanAttributesConfigurator

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/BeanAttributesConfiguratorImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/BeanAttributesConfiguratorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/BeanAttributesConfiguratorImpl.java?rev=1797820&r1=1797819&r2=1797820&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/BeanAttributesConfiguratorImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/configurator/BeanAttributesConfiguratorImpl.java
Tue Jun  6 20:11:57 2017
@@ -26,8 +26,10 @@ import java.lang.reflect.Type;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.webbeans.annotation.AnyLiteral;
 import org.apache.webbeans.component.BeanAttributesImpl;
 import org.apache.webbeans.config.WebBeansContext;
+import org.apache.webbeans.util.GenericsUtil;
 
 public class BeanAttributesConfiguratorImpl<T> implements BeanAttributesConfigurator<T>
 {
@@ -86,9 +88,12 @@ public class BeanAttributesConfiguratorI
     @Override
     public BeanAttributesConfigurator<T> addTransitiveTypeClosure(Type type)
     {
-        throw new UnsupportedOperationException("TODO implement CDI 2.0");
+        Set<Type> typeClosure = GenericsUtil.getTypeClosure(type, type);
+        types.addAll(typeClosure);
+        return this;
     }
 
+
     @Override
     public BeanAttributesConfigurator<T> types(Type... types)
     {
@@ -193,6 +198,9 @@ public class BeanAttributesConfiguratorI
 
     public BeanAttributes<T> getBeanAttributes()
     {
+        // make sure we always have an @Any Qualifier as well.
+        qualifiers.add(AnyLiteral.INSTANCE);
+
         return new BeanAttributesImpl<T>(types, qualifiers, scope, name, false, stereotypes,
alternative);
     }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=1797820&r1=1797819&r2=1797820&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
Tue Jun  6 20:11:57 2017
@@ -1731,6 +1731,8 @@ public final class WebBeansUtil
         }
     }
 
+
+
     public void checkTypeVariables(final TypeLiteral<?> subtype)
     {
         final Type t = subtype.getType();



Mime
View raw message