tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1429180 - /tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java
Date Sat, 05 Jan 2013 01:10:57 GMT
Author: kkolinko
Date: Sat Jan  5 01:10:57 2013
New Revision: 1429180

URL: http://svn.apache.org/viewvc?rev=1429180&view=rev
Log:
Simplify. We are returning "null" on failure, so there is no need to check whether it is not-null
before returning it.

Modified:
    tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java

Modified: tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java?rev=1429180&r1=1429179&r2=1429180&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java (original)
+++ tomcat/trunk/java/org/apache/catalina/security/SecurityUtil.java Sat Jan  5 01:10:57 2013
@@ -339,23 +339,17 @@ public final class SecurityUtil{
      */
     private static Method findMethod(Method[] methodsCache,
                                      String methodName){
-        if (methodName.equals(INIT_METHOD)
-                && methodsCache[INIT] != null){
+        if (methodName.equals(INIT_METHOD)){
             return methodsCache[INIT];
-        } else if (methodName.equals(DESTROY_METHOD)
-                && methodsCache[DESTROY] != null){
+        } else if (methodName.equals(DESTROY_METHOD)){
             return methodsCache[DESTROY];
-        } else if (methodName.equals(SERVICE_METHOD)
-                && methodsCache[SERVICE] != null){
+        } else if (methodName.equals(SERVICE_METHOD)){
             return methodsCache[SERVICE];
-        } else if (methodName.equals(DOFILTER_METHOD)
-                && methodsCache[DOFILTER] != null){
+        } else if (methodName.equals(DOFILTER_METHOD)){
             return methodsCache[DOFILTER];
-        } else if (methodName.equals(EVENT_METHOD)
-                && methodsCache[EVENT] != null){
+        } else if (methodName.equals(EVENT_METHOD)){
             return methodsCache[EVENT];
-        } else if (methodName.equals(DOFILTEREVENT_METHOD)
-                && methodsCache[DOFILTEREVENT] != null){
+        } else if (methodName.equals(DOFILTEREVENT_METHOD)){
             return methodsCache[DOFILTEREVENT];
         }
         return null;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message