@Test public void testPromoteBigIntegerAndBigDecimalResultsInBigDecimalType() { Assert.assertEquals(BigDecimalType.TYPE, Arith.promote(DoubleType.TYPE, BigIntegerType.TYPE)); }
public static Type promote(Type operand1, Type operand2) { if ((operand1 instanceof BigIntegerType && operand2 instanceof DoubleType) || (operand1 instanceof DoubleType && operand2 instanceof BigIntegerType)) { return BigDecimalType.TYPE; } else { int o1 = arithType(operand1); int o2 = arithType(operand2); return arithType(Math.max(o1, o2)); } }
Arith { public static Type promote(Type operand1, Type operand2) { if ((operand1 instanceof BigIntegerType && operand2 instanceof DoubleType) || (operand1 instanceof DoubleType && operand2 instanceof BigIntegerType)) { return BigDecimalType.TYPE; } else { int o1 = arithType(operand1); int o2 = arithType(operand2); return arithType(Math.max(o1, o2)); } } }
Arith { public static Type promote(Type operand1, Type operand2) { if ((operand1 instanceof BigIntegerType && operand2 instanceof DoubleType) || (operand1 instanceof DoubleType && operand2 instanceof BigIntegerType)) { return BigDecimalType.TYPE; } else { int o1 = arithType(operand1); int o2 = arithType(operand2); return arithType(Math.max(o1, o2)); } } private  Arith(); }
Arith { public static Type promote(Type operand1, Type operand2) { if ((operand1 instanceof BigIntegerType && operand2 instanceof DoubleType) || (operand1 instanceof DoubleType && operand2 instanceof BigIntegerType)) { return BigDecimalType.TYPE; } else { int o1 = arithType(operand1); int o2 = arithType(operand2); return arithType(Math.max(o1, o2)); } } private  Arith(); static Object add(Object operand1,
                             Object operand2,
                             Type resultType); static Type promote(Type operand1,
                               Type operand2); }
Arith { public static Type promote(Type operand1, Type operand2) { if ((operand1 instanceof BigIntegerType && operand2 instanceof DoubleType) || (operand1 instanceof DoubleType && operand2 instanceof BigIntegerType)) { return BigDecimalType.TYPE; } else { int o1 = arithType(operand1); int o2 = arithType(operand2); return arithType(Math.max(o1, o2)); } } private  Arith(); static Object add(Object operand1,
                             Object operand2,
                             Type resultType); static Type promote(Type operand1,
                               Type operand2);  }