openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1435420 - in /openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/component/creation/DecoratorBeanBuilder.java main/java/org/apache/webbeans/portable/InjectionTargetImpl.java test/java/org/apache/webbeans/test/TestContext.java
Date Fri, 18 Jan 2013 23:59:27 GMT
Author: arne
Date: Fri Jan 18 23:59:26 2013
New Revision: 1435420

URL: http://svn.apache.org/viewvc?rev=1435420&view=rev
Log:
OWB-344: Abstract decorator work in progress

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/portable/InjectionTargetImpl.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java

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=1435420&r1=1435419&r2=1435420&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
Fri Jan 18 23:59:26 2013
@@ -350,7 +350,7 @@ public class DecoratorBeanBuilder<T> ext
      */
     private static class AbstractDecoratorInjectionTarget<T> extends InjectionTargetImpl<T>
     {
-        private Class<? extends T> proxySubClass = null;
+        private Class<T> proxySubClass = null;
 
         private AbstractDecoratorInjectionTarget(AnnotatedType<T> annotatedType, Set<InjectionPoint>
points, WebBeansContext webBeansContext,
                                                  List<AnnotatedMethod<?>> postConstructMethods,
List<AnnotatedMethod<?>> preDestroyMethods)
@@ -359,24 +359,13 @@ public class DecoratorBeanBuilder<T> ext
         }
 
         @Override
-        protected AnnotatedConstructor<T> getConstructor()
+        protected AnnotatedConstructor<T> createConstructor()
         {
-            if (constructor != null)
-            {
-                return constructor;
-            }
-            else
-            {
-                //X TODO create proxy subclass
-
-                Constructor<T> ct = webBeansContext.getWebBeansUtil().getNoArgConstructor(proxySubClass);
-                this.constructor = new AnnotatedConstructorImpl<T>(webBeansContext,
ct, annotatedType);
-
-                //X TODO what about @Inject constructors?
-
-            }
-
-            return constructor;
+            //X TODO create proxy subclass
+            
+            //X TODO what about @Inject constructors?
+            Constructor<T> ct = webBeansContext.getWebBeansUtil().getNoArgConstructor(proxySubClass);
+            return new AnnotatedConstructorImpl<T>(webBeansContext, ct, annotatedType);
         }
 
     }

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=1435420&r1=1435419&r2=1435420&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
Fri Jan 18 23:59:26 2013
@@ -387,10 +387,15 @@ public class InjectionTargetImpl<T> exte
 
     protected AnnotatedConstructor<T> getConstructor()
     {
-        if (constructor != null)
+        if (constructor == null)
         {
-            return constructor;
+            constructor = createConstructor();
         }
+        return constructor;
+    }
+    
+    protected AnnotatedConstructor<T> createConstructor()
+    {
         AnnotatedConstructor<T> constructor = null;
         for (InjectionPoint injectionPoint : getInjectionPoints())
         {
@@ -409,13 +414,12 @@ public class InjectionTargetImpl<T> exte
         }
         if (constructor != null)
         {
-            this.constructor = constructor;
+            return constructor;
         }
         else
         {
-            this.constructor = new AnnotatedConstructorImpl<T>(webBeansContext, getDefaultConstructor(),
annotatedType);
+            return new AnnotatedConstructorImpl<T>(webBeansContext, getDefaultConstructor(),
annotatedType);
         }
-        return this.constructor;
     }
 
     private Constructor<T> getDefaultConstructor()

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java?rev=1435420&r1=1435419&r2=1435420&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/TestContext.java
Fri Jan 18 23:59:26 2013
@@ -487,7 +487,6 @@ public abstract class TestContext implem
      * @return the newly created Simple WebBean Component
      * @throws WebBeansConfigurationException if any configuration exception occurs
      */
-    @SuppressWarnings("unchecked")
     private <T> ManagedBean<T> define(Class<T> clazz, WebBeansType type,
AnnotatedType<T> anntotatedType) throws WebBeansConfigurationException
     {
         WebBeansContext webBeansContext = WebBeansContext.currentInstance();



Mime
View raw message