openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r932379 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept: InterceptorDataImpl.java InterceptorHandler.java InvocationContextImpl.java
Date Fri, 09 Apr 2010 12:24:12 GMT
Author: struberg
Date: Fri Apr  9 12:24:12 2010
New Revision: 932379

URL: http://svn.apache.org/viewvc?rev=932379&view=rev
Log:
OWB-275 remove unused code blocks

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InvocationContextImpl.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java?rev=932379&r1=932378&r2=932379&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
Fri Apr  9 12:24:12 2010
@@ -304,64 +304,57 @@ public class InterceptorDataImpl impleme
             {
                 return this.decoratorInterceptor; 
             }
-            else
+            
+            interceptor = ownerCreationalContext.getDependentInterceptor(this.webBeansInterceptor);
+            //There is no define interceptor, define and add it into dependent
+            if(interceptor == null)
             {
-                interceptor = ownerCreationalContext.getDependentInterceptor(this.webBeansInterceptor);
-                //There is no define interceptor, define and add it into dependent
-                if(interceptor == null)
-                {
-                    BeanManagerImpl manager = BeanManagerImpl.getManager();
-                    
-                    WebBeansInterceptor<Object> actualInterceptor = (WebBeansInterceptor<Object>)this.webBeansInterceptor;
-                    CreationalContext<Object> creationalContext = manager.createCreationalContext(actualInterceptor);
-                    interceptor = manager.getReference(actualInterceptor,actualInterceptor.getBeanClass(),
creationalContext);
-                    
-                    actualInterceptor.setInjections(interceptor, creationalContext);
+                BeanManagerImpl manager = BeanManagerImpl.getManager();
+                
+                WebBeansInterceptor<Object> actualInterceptor = (WebBeansInterceptor<Object>)this.webBeansInterceptor;
+                CreationalContext<Object> creationalContext = manager.createCreationalContext(actualInterceptor);
+                interceptor = manager.getReference(actualInterceptor,actualInterceptor.getBeanClass(),
creationalContext);
+                
+                actualInterceptor.setInjections(interceptor, creationalContext);
 
-                    if (ownerCreationalContext != null)
-                    {
-                        ownerCreationalContext.addDependent((WebBeansInterceptor<Object>)this.webBeansInterceptor,
interceptor, creationalContext);
-                    }                
-                }                
+                ownerCreationalContext.addDependent((WebBeansInterceptor<Object>)this.webBeansInterceptor,
interceptor, creationalContext);
             }
             
             return interceptor;
         }
-        else
+
+        EjbInterceptorContext ctx = null;
+        Object interceptor = null;       
+        //control for this InterceptorData is defined by interceptor class
+        if(this.definedInInterceptorClass)
         {
-            EjbInterceptorContext ctx = null;
-            Object interceptor = null;       
-            //control for this InterceptorData is defined by interceptor class
-            if(this.definedInInterceptorClass)
-            {
-                ctx = ownerCreationalContext.getEjbInterceptor(this.interceptorClass);  
             
-                if(ctx == null)
-                {                    
-                    interceptor = WebBeansUtil.newInstanceForced(this.interceptorClass);
-                    try
-                    {
-                        OWBInjector injector = new OWBInjector();
-                        injector.inject(interceptor);
-                        
-                        ctx = new EjbInterceptorContext();
-                        ctx.setInjectorInstance(injector);
-                        ctx.setInterceptorInstance(interceptor);
-                    }
-                    catch (Exception e)
-                    {
-                        logger.error("Unable to inject dependencies of EJB interceptor instance
with class : " + interceptorClass,e);
-                    }          
+            ctx = ownerCreationalContext.getEjbInterceptor(this.interceptorClass);      
         
+            if(ctx == null)
+            {                    
+                interceptor = WebBeansUtil.newInstanceForced(this.interceptorClass);
+                try
+                {
+                    OWBInjector injector = new OWBInjector();
+                    injector.inject(interceptor);
                     
-                    ownerCreationalContext.addEjbInterceptor(interceptorClass, ctx);
+                    ctx = new EjbInterceptorContext();
+                    ctx.setInjectorInstance(injector);
+                    ctx.setInterceptorInstance(interceptor);
                 }
-                else
+                catch (Exception e)
                 {
-                    interceptor = ctx.getInterceptorInstance();
-                }
+                    logger.error("Unable to inject dependencies of EJB interceptor instance
with class : " + interceptorClass,e);
+                }          
+                
+                ownerCreationalContext.addEjbInterceptor(interceptorClass, ctx);
+            }
+            else
+            {
+                interceptor = ctx.getInterceptorInstance();
             }
+        }
 
-            return interceptor; 
-        }        
+        return interceptor; 
     }
 
 }
\ No newline at end of file

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java?rev=932379&r1=932378&r2=932379&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
Fri Apr  9 12:24:12 2010
@@ -240,7 +240,7 @@ public abstract class InterceptorHandler
                             }
                             
                             this.interceptedMethodMap.put(method, filteredInterceptorStack);
-                        }    
+                        }
                         
                         // Call Around Invokes
                         if (WebBeansUtil.isContainsInterceptorMethod(this.interceptedMethodMap.get(method),
InterceptorType.AROUND_INVOKE))
@@ -363,7 +363,7 @@ public abstract class InterceptorHandler
             {
                 it.remove();
             }
-        }        
+        }
     }
         
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InvocationContextImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InvocationContextImpl.java?rev=932379&r1=932378&r2=932379&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InvocationContextImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InvocationContextImpl.java
Fri Apr  9 12:24:12 2010
@@ -150,10 +150,7 @@ public class InvocationContextImpl imple
             {
                 return proceedAroundInvokes(this.interceptorDatas);
             }
-            else
-            {
-                return proceedCommonAnnots(this.interceptorDatas, this.type);
-            }
+            return proceedCommonAnnots(this.interceptorDatas, this.type);
 
         }
         catch (InvocationTargetException ite)
@@ -167,10 +164,7 @@ public class InvocationContextImpl imple
             {
                 throw (Exception) t;
             }
-            else
-            {
-                throw ite;
-            }
+            throw ite;
         }
         catch (Exception e)
         {



Mime
View raw message