case Equal:
case NotEqual:
return getEqualsMethodBasedBinaryOperator(binaryType, left, right);
}
final Type leftType = left.getType();
final Type rightType = right.getType();
if (name != null) {
// try exact match first
MethodInfo method = getBinaryOperatorStaticMethod(binaryType, leftType, rightType, name);
if (method != null) {
return new MethodBinaryExpression(binaryType, left, right, method.getReturnType(), method);
}
method = getBinaryOperatorMethod(binaryType, leftType, rightType, name);
if (method != null) {
return new MethodBinaryExpression(binaryType, left, right, method.getReturnType(), method);
}
// try auto(un)boxing call
if (TypeUtils.isAutoUnboxed(rightType)) {
final Type unboxedRightType = TypeUtils.getUnderlyingPrimitive(rightType);
method = getBinaryOperatorMethod(binaryType, leftType, unboxedRightType, name);
if (method != null) {
return new MethodBinaryExpression(binaryType, left, right, method.getReturnType(), method);
}
}
else if (rightType.isPrimitive()) {
if (TypeUtils.isAutoUnboxed(rightType)) {
final Type boxedRightType = TypeUtils.getBoxedType(rightType);
method = getBinaryOperatorMethod(binaryType, leftType, boxedRightType, name);
if (method != null) {
return new MethodBinaryExpression(binaryType, left, right, method.getReturnType(), method);