jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ari...@apache.org
Subject cvs commit: jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/test evaluationTests.txt evaluationTestsOutput.txt
Date Mon, 15 Apr 2002 14:24:12 GMT
arista      02/04/15 07:24:12

  Modified:    standard/src/org/apache/taglibs/standard/lang/jstl
                        Coercions.java GreaterThanOperator.java
                        GreaterThanOrEqualsOperator.java
                        LessThanOperator.java LessThanOrEqualsOperator.java
               standard/src/org/apache/taglibs/standard/lang/jstl/test
                        evaluationTests.txt evaluationTestsOutput.txt
  Log:
  Bug 8105 - Change EL relop rules with regard to null
  
  Fixed by changing the LessThanOperator, LessThanOrEqualsOperator,
  GreaterThanOperator, GreaterThanOrEqualsOperator
  
  Revision  Changes    Path
  1.5       +3 -1      jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/Coercions.java
  
  Index: Coercions.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/Coercions.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Coercions.java	14 Apr 2002 23:34:58 -0000	1.4
  +++ Coercions.java	15 Apr 2002 14:24:12 -0000	1.5
  @@ -140,6 +140,8 @@
    *         return true
    *       otherwise
    *         return false
  + *     if A or B is null
  + *       return false
    *     if A or B is Float or Double
    *       coerce both A and B to Double
    *       apply operator
  
  
  
  1.3       +5 -1      jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/GreaterThanOperator.java
  
  Index: GreaterThanOperator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/GreaterThanOperator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GreaterThanOperator.java	14 Apr 2002 14:32:35 -0000	1.2
  +++ GreaterThanOperator.java	15 Apr 2002 14:24:12 -0000	1.3
  @@ -108,6 +108,10 @@
       if (pLeft == pRight) {
         return Boolean.FALSE;
       }
  +    else if (pLeft == null ||
  +	     pRight == null) {
  +      return Boolean.FALSE;
  +    }
       else {
         return super.apply (pLeft, pRight, pContext, pLogger);
       }
  
  
  
  1.3       +5 -1      jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/GreaterThanOrEqualsOperator.java
  
  Index: GreaterThanOrEqualsOperator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/GreaterThanOrEqualsOperator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GreaterThanOrEqualsOperator.java	14 Apr 2002 14:32:35 -0000	1.2
  +++ GreaterThanOrEqualsOperator.java	15 Apr 2002 14:24:12 -0000	1.3
  @@ -108,6 +108,10 @@
       if (pLeft == pRight) {
         return Boolean.TRUE;
       }
  +    else if (pLeft == null ||
  +	     pRight == null) {
  +      return Boolean.FALSE;
  +    }
       else {
         return super.apply (pLeft, pRight, pContext, pLogger);
       }
  
  
  
  1.3       +5 -1      jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/LessThanOperator.java
  
  Index: LessThanOperator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/LessThanOperator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LessThanOperator.java	14 Apr 2002 14:32:35 -0000	1.2
  +++ LessThanOperator.java	15 Apr 2002 14:24:12 -0000	1.3
  @@ -108,6 +108,10 @@
       if (pLeft == pRight) {
         return Boolean.FALSE;
       }
  +    else if (pLeft == null ||
  +	     pRight == null) {
  +      return Boolean.FALSE;
  +    }
       else {
         return super.apply (pLeft, pRight, pContext, pLogger);
       }
  
  
  
  1.3       +5 -1      jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/LessThanOrEqualsOperator.java
  
  Index: LessThanOrEqualsOperator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/LessThanOrEqualsOperator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LessThanOrEqualsOperator.java	14 Apr 2002 14:32:35 -0000	1.2
  +++ LessThanOrEqualsOperator.java	15 Apr 2002 14:24:12 -0000	1.3
  @@ -108,6 +108,10 @@
       if (pLeft == pRight) {
         return Boolean.TRUE;
       }
  +    else if (pLeft == null ||
  +	     pRight == null) {
  +      return Boolean.FALSE;
  +    }
       else {
         return super.apply (pLeft, pRight, pContext, pLogger);
       }
  
  
  
  1.7       +51 -0     jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/test/evaluationTests.txt
  
  Index: evaluationTests.txt
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/test/evaluationTests.txt,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- evaluationTests.txt	15 Apr 2002 13:20:12 -0000	1.6
  +++ evaluationTests.txt	15 Apr 2002 14:24:12 -0000	1.7
  @@ -806,3 +806,54 @@
   java.lang.Object
   ${ 9220838762064379904 - 9220838762064379900 }
   java.lang.Object
  +
  +#######################################################
  +# test relational operators involving null
  +
  +${ null == null }
  +java.lang.Object
  +${ null != null }
  +java.lang.Object
  +${ null > null }
  +java.lang.Object
  +${ null < null }
  +java.lang.Object
  +${ null >= null }
  +java.lang.Object
  +${ null <= null }
  +java.lang.Object
  +
  +${ null == 3 }
  +java.lang.Object
  +${ null != 3 }
  +java.lang.Object
  +${ null > 3 }
  +java.lang.Object
  +${ null < 3 }
  +java.lang.Object
  +${ null >= 3 }
  +java.lang.Object
  +${ null <= 3 }
  +java.lang.Object
  +
  +${ 3 == null }
  +java.lang.Object
  +${ 3 != null }
  +java.lang.Object
  +${ 3 > null }
  +java.lang.Object
  +${ 3 < null }
  +java.lang.Object
  +${ 3 >= null }
  +java.lang.Object
  +${ 3 <= null }
  +java.lang.Object
  +
  +${ null == "" }
  +java.lang.Object
  +${ null != "" }
  +java.lang.Object
  +${ "" == null }
  +java.lang.Object
  +${ "" != null }
  +java.lang.Object
  
  
  
  1.8       +117 -0    jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/test/evaluationTestsOutput.txt
  
  Index: evaluationTestsOutput.txt
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/jstl/test/evaluationTestsOutput.txt,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- evaluationTestsOutput.txt	15 Apr 2002 13:20:12 -0000	1.7
  +++ evaluationTestsOutput.txt	15 Apr 2002 14:24:12 -0000	1.8
  @@ -1807,3 +1807,120 @@
   Evaluates to: 4
   With type: java.lang.Long
   
  +
  +#######################################################
  +# test relational operators involving null
  +
  +Expression: ${ null == null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: true
  +With type: java.lang.Boolean
  +
  +Expression: ${ null != null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ null > null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ null < null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ null >= null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: true
  +With type: java.lang.Boolean
  +
  +Expression: ${ null <= null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: true
  +With type: java.lang.Boolean
  +
  +
  +Expression: ${ null == 3 }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ null != 3 }
  +ExpectedType: class java.lang.Object
  +Evaluates to: true
  +With type: java.lang.Boolean
  +
  +Expression: ${ null > 3 }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ null < 3 }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ null >= 3 }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ null <= 3 }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +
  +Expression: ${ 3 == null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ 3 != null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: true
  +With type: java.lang.Boolean
  +
  +Expression: ${ 3 > null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ 3 < null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ 3 >= null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ 3 <= null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +
  +Expression: ${ null == "" }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ null != "" }
  +ExpectedType: class java.lang.Object
  +Evaluates to: true
  +With type: java.lang.Boolean
  +
  +Expression: ${ "" == null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: false
  +With type: java.lang.Boolean
  +
  +Expression: ${ "" != null }
  +ExpectedType: class java.lang.Object
  +Evaluates to: true
  +With type: java.lang.Boolean
  +
  
  
  

--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message