예제 #1
0
 /**
  * Finds the node causing a NPE for diadic operators.
  * @param xrt the RuntimeException
  * @param node the parent node
  * @param left the left argument
  * @param right the right argument
  * @return the left, right or parent node
  */
 protected JexlNode findNullOperand(RuntimeException xrt, JexlNode node, Object left, Object right) {
     if (xrt instanceof ArithmeticException
         && JexlException.NULL_OPERAND == xrt.getMessage()) {
         if (left == null)
         {
             return node.jjtGetChild(0);
         }
         if (right == null)
         {
             return node.jjtGetChild(1);
         }
     }
     return node;
 }