openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1434707 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: decorator/DecoratorUtil.java decorator/WebBeansDecoratorConfig.java intercept/InterceptorHandlerPleaseRemove.java proxy/ProxyFactory.java
Date Thu, 17 Jan 2013 15:09:32 GMT
Author: struberg
Date: Thu Jan 17 15:09:32 2013
New Revision: 1434707

URL: http://svn.apache.org/viewvc?rev=1434707&view=rev
Log:
OWB-344 remove unnecessary WebBeansDecorator casts

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandlerPleaseRemove.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java?rev=1434707&r1=1434706&r2=1434707&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java
Thu Jan 17 15:09:32 2013
@@ -21,7 +21,6 @@ package org.apache.webbeans.decorator;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.logging.Level;
@@ -106,11 +105,9 @@ public final class DecoratorUtil
                 if (!method.isSynthetic() && !method.isBridge() && !Modifier.isStatic(modifiers)
&& !Modifier.isPrivate(modifiers) && Modifier.isFinal(modifiers))
                 {
                     // Check decorator implements this
-                    Iterator<Decorator<?>> itDecorator = decoratorList.iterator();
-                    while (itDecorator.hasNext())
+                    for (Decorator<?> decorator : decoratorList)
                     {
-                        WebBeansDecorator<?> decorator = (WebBeansDecorator<?>)
itDecorator.next();
-                        Class<?> decClazz = decorator.getClazz();
+                        Class<?> decClazz = decorator.getBeanClass();
 
                         try
                         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java?rev=1434707&r1=1434706&r2=1434707&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
Thu Jan 17 15:09:32 2013
@@ -76,7 +76,9 @@ public final class WebBeansDecoratorConf
         {
             logger.log(Level.FINE, "Configuring decorator class : [{0}]", delegate.getReturnType());
         }
+        //X TODO no more delegation!
         WebBeansDecorator<T> decorator = new WebBeansDecorator<T>(delegate);
+
         delegate.getWebBeansContext().getDecoratorsManager().addDecorator(decorator);
     }
 
@@ -97,13 +99,9 @@ public final class WebBeansDecoratorConf
         if(decoratorList != null && !decoratorList.isEmpty())
         {
             DecoratorUtil.checkManagedBeanDecoratorConditions(component, decoratorList);
-            Iterator<Decorator<?>> itList = decoratorList.iterator();
 
-            while (itList.hasNext())
-            {
-                WebBeansDecorator<?> decorator = (WebBeansDecorator<?>) itList.next();
           
-                component.getDecoratorStack().add(decorator);            
-            }            
+            component.getDecoratorStack().addAll(decoratorList);
+
             filterDecoratorsPerBDA(component,component.getDecoratorStack());
         }
     }
@@ -120,15 +118,13 @@ public final class WebBeansDecoratorConf
         String beanBDABeansXML = beansXMLScanner.getBeansXml(component.getBeanClass());
         Set<Class<?>> definedDecorators = beansXMLScanner.getDecorators(beanBDABeansXML);
 
-        WebBeansDecorator<?> dec;
-
         if (stack != null && stack.size() > 0)
         {
             Iterator<Decorator<?>> it = stack.iterator();
             while (it.hasNext())
             {
-                dec = (WebBeansDecorator<?>) it.next();
-                if (!definedDecorators.contains(dec.getClazz()))
+                Decorator<?> dec = it.next();
+                if (!definedDecorators.contains(dec.getBeanClass()))
                 {
                     it.remove();
                 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandlerPleaseRemove.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandlerPleaseRemove.java?rev=1434707&r1=1434706&r2=1434707&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandlerPleaseRemove.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandlerPleaseRemove.java
Thu Jan 17 15:09:32 2013
@@ -136,9 +136,6 @@ import org.apache.webbeans.util.ClassUti
  * 
  * @see WebBeansInterceptorConfig
  * @see WebBeansDecoratorConfig
- * @see org.apache.webbeans.intercept.webbeans.WebBeansInterceptorBeanPleaseRemove
- * @see org.apache.webbeans.decorator.WebBeansDecorator
- * @see org.apache.webbeans.intercept.ejb.EJBInterceptorConfig
  *
  * @deprecated the whole interceptor stack will be changed to the new ASM based proxying.
  */

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java?rev=1434707&r1=1434706&r2=1434707&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java
Thu Jan 17 15:09:32 2013
@@ -163,7 +163,7 @@ public final class ProxyFactory
 
 
             result = createProxyRemove(proxyClass);
-            
+
             if (!(bean instanceof WebBeansDecorator<?>) && !(bean instanceof
WebBeansInterceptorBeanPleaseRemove<?>))
             {
                 InterceptorHandlerPleaseRemove interceptorHandler = createInterceptorHandlerRemove(bean,
creationalContext);



Mime
View raw message