public static boolean isNumber(Object val) { if (val == null) return false; if (val instanceof String) return isNumber((String) val); if (val instanceof char[]) return isNumber((char[]) val); return val instanceof Integer || val instanceof BigDecimal || val instanceof BigInteger || val instanceof Float || val instanceof Double || val instanceof Long || val instanceof Short || val instanceof Character; }
public static boolean isNumber(Object val) { if (val == null) return false; if (val instanceof String) return isNumber((String) val); if (val instanceof char[]) return isNumber(new String((char[]) val)); return val instanceof Integer || val instanceof BigDecimal || val instanceof BigInteger || val instanceof Float || val instanceof Double || val instanceof Long || val instanceof Short || val instanceof Character; }
public static boolean isNumber(Object val) { if (val == null) return false; if (val instanceof String) return isNumber((String) val); if (val instanceof char[]) return isNumber(new String((char[]) val)); return val instanceof Integer || val instanceof BigDecimal || val instanceof BigInteger || val instanceof Float || val instanceof Double || val instanceof Long || val instanceof Short || val instanceof Character; }
@SuppressWarnings({"SuspiciousMethodCalls"}) protected void setName(char[] name) { if (isNumber(name, start, offset)) { egressType = (literal = handleNumericConversion(name, start, offset)).getClass(); if (((fields |= NUMERIC | LITERAL | IDENTIFIER) & INVERT) != 0) {
@SuppressWarnings({"SuspiciousMethodCalls"}) protected void setName(char[] name) { if (isNumber(name)) { egressType = (literal = handleNumericConversion(name)).getClass(); if (((fields |= NUMERIC | LITERAL | IDENTIFIER) & INVERT) != 0) {
@SuppressWarnings({"SuspiciousMethodCalls"}) protected void setName(char[] name) { if (isNumber(name, start, offset)) { egressType = (literal = handleNumericConversion(name, start, offset)).getClass(); if (((fields |= NUMERIC | LITERAL | IDENTIFIER) & INVERT) != 0) {
private static Object _doOperations(int type1, Object val1, int operation, int type2, Object val2) { if (operation < 20) { if (type1 > 99 && type1 == type2) { return doOperationsSameType(type1, val1, operation, val2); } else if ((type1 > 99 && (type2 > 99)) || (operation != 0 && isNumber(val1) && isNumber(val2))) { return doBigDecimalArithmetic(getInternalNumberFromType(val1, type1), operation, getInternalNumberFromType(val2, type2), true, box(type2) > box(type1) ? box(type2) : box(type1)); } else if (operation != ADD && (type1 == 15 || type2 == 15) && type1 != type2 && type1 != EMPTY && type2 != EMPTY) { return doOperationNonNumeric(convert(val1, Boolean.class), operation, convert(val2, Boolean.class)); } // Fix for: MVEL-56 else if ((type1 == 1 || type2 == 1) && (type1 == 8 || type1 == 112 || type2 == 8 || type2 == 112)) { if (type1 == 1) { return doOperationNonNumeric(val1, operation, valueOf(val2)); } else { return doOperationNonNumeric(valueOf(val1), operation, val2); } } } return doOperationNonNumeric(val1, operation, val2); }