@Override
public boolean evaluate() {
// JCR 2.0 spec, 6.7.16 Comparison:
// "operand1 may evaluate to an array of values"
// TODO support arrays
CoreValue v1 = operand1.currentValue();
// "operand2 always evaluates to a scalar value"
CoreValue v2 = operand2.currentValue();
if (v1 == null || v2 == null) {
// TODO comparison: what about (null <> x) ?
return false;
}
if (v1.getType() != v2.getType()) {
// "the value of operand2 is converted to the
// property type of the value of operand1"
v2 = convert(v2, v1.getType());
}
switch (operator) {