MCPcopy Index your code
hub / github.com/beanshell/beanshell / evaluateCondition

Method evaluateCondition

src/bsh/BSHIfStatement.java:51–69  ·  view source on GitHub ↗
(
		SimpleNode condExp, CallStack callstack, Interpreter interpreter)

Source from the content-addressed store, hash-verified

49 }
50
51 public static boolean evaluateCondition(
52 SimpleNode condExp, CallStack callstack, Interpreter interpreter)
53 throws EvalError
54 {
55 Object obj = condExp.eval(callstack, interpreter);
56 if(obj instanceof Primitive) {
57 if ( obj == Primitive.VOID )
58 throw new EvalError("Condition evaluates to void type",
59 condExp, callstack );
60 obj = ((Primitive)obj).getValue();
61 }
62
63 if(obj instanceof Boolean)
64 return ((Boolean)obj).booleanValue();
65 else
66 throw new EvalError(
67 "Condition must evaluate to a Boolean or boolean.",
68 condExp, callstack );
69 }
70}

Callers 4

evalMethod · 0.95
evalMethod · 0.95
evalMethod · 0.95
evalMethod · 0.95

Calls 3

booleanValueMethod · 0.80
evalMethod · 0.65
getValueMethod · 0.45

Tested by

no test coverage detected