Changeset 683:b426de3b32ac in livinglogic.java.ul4

Show
Ignore:
Timestamp:
08/29/12 17:01:21 (7 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Tags:
exp-52
Message:

Fix And evaluation.

The second operand now only get evaluated when the result isn't clear from the
first.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pom.xml

    r682 r683  
    44    <groupId>com.livinglogic</groupId> 
    55    <artifactId>ul4</artifactId> 
    6     <version>0.51</version> 
     6    <version>0.52</version> 
    77    <packaging>jar</packaging> 
    88    <name>UL4</name> 
  • src/main/java/com/livinglogic/ul4/And.java

    r648 r683  
    2323    public Object evaluate(EvaluationContext context) throws IOException 
    2424    { 
    25         Object obj2ev = obj2.decoratedEvaluate(context); 
    26         if (FunctionBool.call(obj2ev)) 
    27             return obj1.decoratedEvaluate(context); 
     25        Object obj1ev = obj1.decoratedEvaluate(context); 
     26        if (!FunctionBool.call(obj1ev)) 
     27            return obj1ev; 
    2828        else 
    29             return obj2ev; 
     29            return obj2.decoratedEvaluate(context); 
    3030    } 
    3131