text: public static Boolean coerceValueToBoolean(ValueEval ve, boolean stringsAreBlanks) throws EvaluationException {if (ve == null || ve == BlankEval.instance) {return null;}if (ve instanceof BoolEval) {return Boolean.valueOf(((BoolEval) ve).getBooleanValue());}if (ve instanceof StringEval) {if (stringsAreBlanks) {return null;}String str = ((StringEval) ve).getStringValue();if (str.equalsIgnoreCase("true")) {return Boolean.TRUE;}if (str.equalsIgnoreCase("false")) {return Boolean.FALSE;}throw new EvaluationException(ErrorEval.VALUE_INVALID);}if (ve instanceof NumericValueEval) {NumericValueEval ne = (NumericValueEval) ve;double d = ne.getNumberValue();if (Double.isNaN(d)) {throw new EvaluationException(ErrorEval.VALUE_INVALID);}return Boolean.valueOf(d != 0);}if (ve instanceof ErrorEval) {throw new EvaluationException((ErrorEval) ve);}throw new RuntimeException("Unexpected eval (" + ve.getClass().getName() + ")");}