openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1681978 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/ webbeans-web/src/main/java/org/apache/webbeans/web/context/ webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/
Date Wed, 27 May 2015 11:20:03 GMT
Author: struberg
Date: Wed May 27 11:20:03 2015
New Revision: 1681978

URL: http://svn.apache.org/r1681978
Log:
OWB-989 remove redundant null checks

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessInjectionPoint.java
    openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
    openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessInjectionPoint.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessInjectionPoint.java?rev=1681978&r1=1681977&r2=1681978&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessInjectionPoint.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessInjectionPoint.java
Wed May 27 11:20:03 2015
@@ -42,7 +42,7 @@ public class GProcessInjectionPoint exte
             {
                 return getInjectionPoint().getBean().getBeanClass();
             }
-            else if (getInjectionPoint().getAnnotated() != null && getInjectionPoint().getAnnotated()
instanceof AnnotatedMember)
+            else if (getInjectionPoint().getAnnotated() instanceof AnnotatedMember)
             {
                 return ((AnnotatedMember) getInjectionPoint().getAnnotated()).getDeclaringType().getJavaClass();
             }

Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java?rev=1681978&r1=1681977&r2=1681978&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
(original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
Wed May 27 11:20:03 2015
@@ -347,7 +347,7 @@ public class WebContextsService extends
 
         Object payload = null;
 
-        if(startupObject != null && startupObject instanceof ServletRequestEvent)
+        if(startupObject instanceof ServletRequestEvent)
         {
             HttpServletRequest request = (HttpServletRequest) ((ServletRequestEvent) startupObject).getServletRequest();
             requestContext.setServletRequest(request);
@@ -512,7 +512,7 @@ public class WebContextsService extends
         // whether the session is destroyed because it is expired
         boolean sessionIsExpiring = false;
 
-        if (endObject != null && endObject instanceof HttpSession)
+        if (endObject instanceof HttpSession)
         {
             session = (HttpSession) endObject;
             if (context == null && session.getAttribute(OWB_SESSION_CONTEXT_ATTRIBUTE_NAME)
!= null)
@@ -610,7 +610,7 @@ public class WebContextsService extends
             // this is needed to get rid of ApplicationScoped beans which are cached inside
the proxies...
             webBeansContext.getBeanManagerImpl().clearCacheProxies();
 
-            Object payload = endObject != null && endObject instanceof ServletContext
? endObject : new Object();
+            Object payload = endObject instanceof ServletContext ? endObject : new Object();
             webBeansContext.getBeanManagerImpl().fireContextLifecyleEvent(
                 payload, DestroyedLiteral.INSTANCE_APPLICATION_SCOPED);
         }
@@ -633,7 +633,7 @@ public class WebContextsService extends
             {
                 singletonContext = new SingletonContext();
                 singletonContext.setActive(true);
-                Object payLoad = startupObject != null && startupObject instanceof
ServletContext
+                Object payLoad = startupObject instanceof ServletContext
                     ? (ServletContext) startupObject : new Object();
                 webBeansContext.getBeanManagerImpl().fireContextLifecyleEvent(
                     payLoad, InitializedLiteral.INSTANCE_SINGLETON_SCOPED);
@@ -668,7 +668,7 @@ public class WebContextsService extends
             return;
         }
 
-        if (startObject != null && startObject instanceof ConversationContext)
+        if (startObject instanceof ConversationContext)
         {
             //X TODO check if this branch is still needed
             ConversationContext context = (ConversationContext) startObject;

Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java?rev=1681978&r1=1681977&r2=1681978&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
(original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/lifecycle/WebContainerLifecycle.java
Wed May 27 11:20:03 2015
@@ -117,7 +117,7 @@ public final class WebContainerLifecycle
         if (startupObject instanceof ServletContext)
         {
             servletContext = (ServletContext)(startupObject);
-            
+
             // Add BeanManager to the 'javax.enterprise.inject.spi.BeanManager' servlet context
attribute
             servletContext.setAttribute(BeanManager.class.getName(), getBeanManager());
         }



Mime
View raw message