incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daw...@apache.org
Subject svn commit: r779776 - in /incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl: LogicalAnd.java LogicalOr.java
Date Thu, 28 May 2009 21:18:43 GMT
Author: dawood
Date: Thu May 28 21:18:43 2009
New Revision: 779776

URL: http://svn.apache.org/viewvc?rev=779776&view=rev
Log:
implement short-circuited evaluation.

Modified:
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalAnd.java
    incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalOr.java

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalAnd.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalAnd.java?rev=779776&r1=779775&r2=779776&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalAnd.java
(original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalAnd.java
Thu May 28 21:18:43 2009
@@ -76,7 +76,7 @@
         try
         {
             boolean left = ((Boolean) _lhsExp.evaluate()).booleanValue();
-            boolean right = ((Boolean) _rhsExp.evaluate()).booleanValue();
+            boolean right = left && ((Boolean) _rhsExp.evaluate()).booleanValue();
 
             logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
          

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalOr.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalOr.java?rev=779776&r1=779775&r2=779776&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalOr.java
(original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/parser/expressions/impl/LogicalOr.java
Thu May 28 21:18:43 2009
@@ -79,7 +79,7 @@
         {
            //System.out.println("Logical OR::LHS type: RHS type ::"+ lhsExp.getType() + ":"
+ rhsExp.getType());
             boolean left = ((Boolean) _lhsExp.evaluate()).booleanValue();
-            boolean right = ((Boolean) _rhsExp.evaluate()).booleanValue();
+            boolean right = left || ((Boolean) _rhsExp.evaluate()).booleanValue();
            //System.out.println("Logical OR::after Evaluation LHS: RHS ::"+ left + ":" +
right);
             logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluate");
             



Mime
View raw message