openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1308196 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: decorator/WebBeansDecoratorConfig.java util/ClassUtil.java
Date Sun, 01 Apr 2012 20:40:15 GMT
Author: struberg
Date: Sun Apr  1 20:40:14 2012
New Revision: 1308196

URL: http://svn.apache.org/viewvc?rev=1308196&view=rev
Log:
remove unecessary null checks

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java

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=1308196&r1=1308195&r2=1308196&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
Sun Apr  1 20:40:14 2012
@@ -150,9 +150,8 @@ public final class WebBeansDecoratorConf
         BeanManager manager = component.getWebBeansContext().getBeanManagerImpl();
         while (itList.hasNext())
         {
-            Object decoratorInstance = null;
-            @SuppressWarnings("unchecked")
-            WebBeansDecorator<Object> decorator = (WebBeansDecorator<Object>)
itList.next();            
+            Object decoratorInstance ;
+            WebBeansDecorator<Object> decorator = (WebBeansDecorator<Object>)
itList.next();
             decoratorInstance = ownerCreationalContext.getDependentDecorator(instance, decorator);
             if(decoratorInstance == null)
             {
@@ -162,14 +161,11 @@ public final class WebBeansDecoratorConf
                 decorator.setInjections(decoratorInstance, creationalContext);
                 decorator.setDelegate(decoratorInstance, delegate);
                 
-                if (ownerCreationalContext != null)
-                {
-                    ownerCreationalContext.addDependent(instance, decorator, decoratorInstance);
-                }                
+                ownerCreationalContext.addDependent(instance, decorator, decoratorInstance);
             }
-            //We found an existing decorator instance, update the delegate
             else
             {
+                //We found an existing decorator instance, update the delegate
                 decorator.setDelegate(decoratorInstance, delegate);
             }
             

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java?rev=1308196&r1=1308195&r2=1308196&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
Sun Apr  1 20:40:14 2012
@@ -1052,7 +1052,7 @@ public final class ClassUtil
 
                 boolean ok = true;
 
-                if (parameterTypes != null && parameterTypes.size() > 0)
+                if (parameterTypes.size() > 0)
                 {
                     ok = false;
                 }



Mime
View raw message