tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r937325 - in /tomcat/trunk/java/org/apache: catalina/ha/session/DeltaManager.java el/lang/ExpressionBuilder.java
Date Fri, 23 Apr 2010 15:09:58 GMT
Author: markt
Date: Fri Apr 23 15:09:58 2010
New Revision: 937325

URL: http://svn.apache.org/viewvc?rev=937325&view=rev
Log:
Remove unnecessary instanceof tests ID'd by FindBugs

Modified:
    tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java
    tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java

Modified: tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java?rev=937325&r1=937324&r2=937325&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java Fri Apr 23 15:09:58
2010
@@ -882,7 +882,7 @@ public class DeltaManager extends Cluste
         if(replicationValve == null) {
             if(container instanceof StandardContext && ((StandardContext)container).getCrossContext())
{
                 Cluster cluster = getCluster() ;
-                if(cluster != null && cluster instanceof CatalinaCluster) {
+                if(cluster != null) {
                     Valve[] valves = ((CatalinaCluster)cluster).getValves();
                     if(valves != null && valves.length > 0) {
                         for(int i=0; replicationValve == null && i < valves.length
; i++ ){

Modified: tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java?rev=937325&r1=937324&r2=937325&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java (original)
+++ tomcat/trunk/java/org/apache/el/lang/ExpressionBuilder.java Fri Apr 23 15:09:58 2010
@@ -94,28 +94,27 @@ public final class ExpressionBuilder imp
                         .CompositeExpression();
 
                 // validate composite expression
-                if (n instanceof AstCompositeExpression) {
-                    int numChildren = n.jjtGetNumChildren();
-                    if (numChildren == 1) {
-                        n = n.jjtGetChild(0);
-                    } else {
-                        Class<?> type = null;
-                        Node child = null;
-                        for (int i = 0; i < numChildren; i++) {
-                            child = n.jjtGetChild(i);
-                            if (child instanceof AstLiteralExpression)
-                                continue;
-                            if (type == null)
-                                type = child.getClass();
-                            else {
-                                if (!type.equals(child.getClass())) {
-                                    throw new ELException(MessageFactory.get(
-                                            "error.mixed", expr));
-                                }
+                int numChildren = n.jjtGetNumChildren();
+                if (numChildren == 1) {
+                    n = n.jjtGetChild(0);
+                } else {
+                    Class<?> type = null;
+                    Node child = null;
+                    for (int i = 0; i < numChildren; i++) {
+                        child = n.jjtGetChild(i);
+                        if (child instanceof AstLiteralExpression)
+                            continue;
+                        if (type == null)
+                            type = child.getClass();
+                        else {
+                            if (!type.equals(child.getClass())) {
+                                throw new ELException(MessageFactory.get(
+                                        "error.mixed", expr));
                             }
                         }
                     }
                 }
+
                 if (n instanceof AstDeferredExpression
                         || n instanceof AstDynamicExpression) {
                     n = n.jjtGetChild(0);



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


Mime
View raw message