openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1435876 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: inject/impl/InjectionPointFactory.java portable/InjectionTargetImpl.java
Date Sun, 20 Jan 2013 16:24:49 GMT
Author: struberg
Date: Sun Jan 20 16:24:49 2013
New Revision: 1435876

URL: http://svn.apache.org/viewvc?rev=1435876&view=rev
Log:
OWB-764 fix multi-InjectionPoint ct handling

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InjectionTargetImpl.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java?rev=1435876&r1=1435875&r2=1435876&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java
Sun Jan 20 16:24:49 2013
@@ -145,7 +145,7 @@ public class InjectionPointFactory
 
         List<AnnotatedParameter<X>> parameters = method.getParameters();
 
-        InjectionPoint point = null;
+        InjectionPoint point;
 
         for(AnnotatedParameter<?> parameter : parameters)
         {
@@ -184,7 +184,7 @@ public class InjectionPointFactory
 
         List<AnnotatedParameter<T>> parameters = constructor.getParameters();
 
-        InjectionPoint point = null;
+        InjectionPoint point;
 
         for(AnnotatedParameter<?> parameter : parameters)
         {
@@ -209,7 +209,7 @@ public class InjectionPointFactory
         AnnotatedConstructor constructor = webBeansContext.getAnnotatedElementFactory().newAnnotatedConstructor((Constructor<Object>)member,annotated);
         List<AnnotatedParameter<?>> parameters = constructor.getParameters();
 
-        InjectionPoint point = null;
+        InjectionPoint point;
 
         for(AnnotatedParameter<?> parameter : parameters)
         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InjectionTargetImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InjectionTargetImpl.java?rev=1435876&r1=1435875&r2=1435876&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InjectionTargetImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InjectionTargetImpl.java
Sun Jan 20 16:24:49 2013
@@ -409,22 +409,12 @@ public class InjectionTargetImpl<T> exte
                 if (constructor == null)
                 {
                     constructor = (AnnotatedConstructor<T>)((AnnotatedParameter<T>)injectionPoint.getAnnotated()).getDeclaringCallable();
-                }
-                else if (!constructor.equals(injectionPoint.getAnnotated()))
-                {
-                    throw new IllegalArgumentException("More than one constructor found for
injection: "
-                                                       + constructor.getJavaMember() + "
and " + injectionPoint.getAnnotated());
+                    return constructor;
                 }
             }
         }
-        if (constructor != null)
-        {
-            return constructor;
-        }
-        else
-        {
-            return new AnnotatedConstructorImpl<T>(webBeansContext, getDefaultConstructor(),
annotatedType);
-        }
+
+        return new AnnotatedConstructorImpl<T>(webBeansContext, getDefaultConstructor(),
annotatedType);
     }
 
     private Constructor<T> getDefaultConstructor()



Mime
View raw message