openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1602765 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ webbeans-tck/
Date Sun, 15 Jun 2014 20:30:23 GMT
Author: struberg
Date: Sun Jun 15 20:30:22 2014
New Revision: 1602765

URL: http://svn.apache.org/r1602765
Log:
OWB-845 remove overly strict generic checks from producer fields

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/DecoratorBeanBuilder.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerFieldBeansBuilder.java
    openwebbeans/trunk/webbeans-tck/standalone-suite.xml

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/DecoratorBeanBuilder.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/DecoratorBeanBuilder.java?rev=1602765&r1=1602764&r2=1602765&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/DecoratorBeanBuilder.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/DecoratorBeanBuilder.java
Sun Jun 15 20:30:22 2014
@@ -23,9 +23,7 @@ import javax.annotation.PreDestroy;
 import javax.decorator.Delegate;
 import javax.enterprise.context.Dependent;
 import javax.enterprise.inject.Alternative;
-import javax.enterprise.inject.Produces;
 import javax.enterprise.inject.spi.AnnotatedMethod;
-import javax.enterprise.inject.spi.AnnotatedParameter;
 import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.InjectionPoint;
 import javax.inject.Inject;
@@ -133,20 +131,6 @@ public class DecoratorBeanBuilder<T> ext
             logger.log(Level.FINE, "Configuring decorator class : [{0}]", annotatedType.getJavaClass());
         }
 
-        Set<AnnotatedMethod<? super T>> methods = annotatedType.getMethods();
-        for(AnnotatedMethod<?> method : methods)
-        {
-            for (AnnotatedParameter<?> parameter : method.getParameters())
-            {
-                if (parameter.isAnnotationPresent(Produces.class))
-                {
-                    throw new WebBeansConfigurationException("Interceptor class : " + annotatedType.getJavaClass()
-                            + " can not have producer methods but it has one with name :
"
-                            + method.getJavaMember().getName());
-                }
-            }
-        }
-
         // make sure that CDI Decorators do not have any Producer methods
         validateNoProducerMethod(annotatedType);
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerFieldBeansBuilder.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerFieldBeansBuilder.java?rev=1602765&r1=1602764&r2=1602765&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerFieldBeansBuilder.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ProducerFieldBeansBuilder.java
Sun Jun 15 20:30:22 2014
@@ -21,8 +21,6 @@ package org.apache.webbeans.component.cr
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -40,9 +38,9 @@ import org.apache.webbeans.exception.Web
 import org.apache.webbeans.spi.api.ResourceReference;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.Asserts;
-import org.apache.webbeans.util.ClassUtil;
 import org.apache.webbeans.util.WebBeansUtil;
 
+
 /**
  * @param <T> bean class type
  */
@@ -75,20 +73,6 @@ public class ProducerFieldBeansBuilder<T
         {
             if(annotatedField.isAnnotationPresent(Produces.class) && annotatedField.getJavaMember().getDeclaringClass().equals(annotatedType.getJavaClass()))
             {
-                Type genericType = annotatedField.getBaseType();
-                
-                if(ClassUtil.isTypeVariable(genericType))
-                {
-                    throw new WebBeansConfigurationException("Producer annotated field :
" + annotatedField + " can not be Wildcard type or Type variable");
-                }
-                if(ClassUtil.isParametrizedType(genericType))
-                {
-                    if(!ClassUtil.checkParametrizedType((ParameterizedType)genericType))
-                    {
-                        throw new WebBeansConfigurationException("Producer annotated field
: " + annotatedField + " can not be Wildcard type or Type variable");
-                    }
-                }
-                
                 Annotation[] anns = AnnotationUtil.asArray(annotatedField.getAnnotations());
                 Field field = annotatedField.getJavaMember();
                 

Modified: openwebbeans/trunk/webbeans-tck/standalone-suite.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tck/standalone-suite.xml?rev=1602765&r1=1602764&r2=1602765&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tck/standalone-suite.xml (original)
+++ openwebbeans/trunk/webbeans-tck/standalone-suite.xml Sun Jun 15 20:30:22 2014
@@ -15,7 +15,7 @@
     the specific language governing permissions and limitations under the
     License.
 -->
-<suite name="JSR-346-TCK" verbose="2" configfailurepolicy="continue"  useDefaultListeners="false">
+<suite name="JSR-346-TCK" verbose="2" configfailurepolicy="continue" >
 
     <listeners>
         <!-- Required - avoid randomly mixed test method execution -->



Mime
View raw message