db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r944174 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java
Date Fri, 14 May 2010 09:42:52 GMT
Author: kahatlen
Date: Fri May 14 09:42:52 2010
New Revision: 944174

URL: http://svn.apache.org/viewvc?rev=944174&view=rev
Log:
DERBY-4651: Hidden assumptions in FromVTI.makeRestriction()

Remove redundant type checks and casts when calling isBooleanTrue()
and isBooleanFalse().

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java?rev=944174&r1=944173&r2=944174&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java Fri May
14 09:42:52 2010
@@ -1332,10 +1332,7 @@ public class FromVTI extends FromTable i
             AndNode andOperator = (AndNode) clause;
 
             // strip off trailing vacuous TRUE constant if present
-            if (
-                andOperator.getRightOperand() instanceof BooleanConstantNode &&
-                ( ((BooleanConstantNode) andOperator.getRightOperand()).isBooleanTrue() )
-                )
+            if ( andOperator.getRightOperand().isBooleanTrue() )
             { return makeRestriction( andOperator.getLeftOperand(), columnNameMap ); }
             
             Restriction leftRestriction = makeRestriction( andOperator.getLeftOperand(),
columnNameMap );
@@ -1350,10 +1347,7 @@ public class FromVTI extends FromTable i
             OrNode orOperator = (OrNode) clause;
             
             // strip off trailing vacuous FALSE constant if present
-            if (
-                orOperator.getRightOperand() instanceof BooleanConstantNode &&
-                ( ((BooleanConstantNode) orOperator.getRightOperand()).isBooleanFalse() )
-                )
+            if ( orOperator.getRightOperand().isBooleanFalse() )
             { return makeRestriction( orOperator.getLeftOperand(), columnNameMap ); }
             
             Restriction leftRestriction = makeRestriction( orOperator.getLeftOperand(), columnNameMap
);



Mime
View raw message