public static Object and ( Object left , Object right , EvaluationContext ctx ) { Boolean l = EvalHelper . getBooleanOrNull ( left ) ; Boolean r = EvalHelper . getBooleanOrNull ( right ) ; // have to check for all nulls first to avoid NPE if ( ( l == null && r == null ) || ( l == null && r == true ) || ( r == null && l == true ) ) { return null ; } else if ( l == null || r == null ) { return false ; } return l && r ; }
Implements the ternary logic AND operation