org_apache_struts_beanvalidation_BeanValidationInterceptorTest_java
org.apache.commons.beanutils.converters.NumberConverter
private <T> T toNumber(Class<?> sourceType, Class<T> targetType, Number value) {
        if (targetType.equals(value.getClass())) {
            return targetType.cast(value);
        }
        if (targetType.equals(Byte.class)) {
            long longValue = value.longValue();
            if (longValue > 127L) {
                throw new ConversionException(this.toString(sourceType) + " value '" + value + "' is too large for " + this.toString(targetType));
            }
            if (longValue < -128L) {
                throw new ConversionException(this.toString(sourceType) + " value '" + value + "' is too small " + this.toString(targetType));
            }
            return targetType.cast(new Byte(value.byteValue()));
        }
        if (targetType.equals(Short.class)) {
            long longValue = value.longValue();
            if (longValue > 32767L) {
                throw new ConversionException(this.toString(sourceType) + " value '" + value + "' is too large for " + this.toString(targetType));
            }
            if (longValue < -32768L) {
                throw new ConversionException(this.toString(sourceType) + " value '" + value + "' is too small " + this.toString(targetType));
            }
            return targetType.cast(new Short(value.shortValue()));
        }
        if (targetType.equals(Integer.class)) {
            long longValue = value.longValue();
            if (longValue > Integer.MAX_VALUE) {
                throw new ConversionException(this.toString(sourceType) + " value '" + value + "' is too large for " + this.toString(targetType));
            }
            if (longValue < Integer.MIN_VALUE) {
                throw new ConversionException(this.toString(sourceType) + " value '" + value + "' is too small " + this.toString(targetType));
            }
            return targetType.cast(new Integer(value.intValue()));
        }
        if (targetType.equals(Long.class)) {
            return targetType.cast(new Long(value.longValue()));
        }
        if (targetType.equals(Float.class)) {
            if (value.doubleValue() > 3.4028234663852886E38) {
                throw new ConversionException(this.toString(sourceType) + " value '" + value + "' is too large for " + this.toString(targetType));
            }
            return targetType.cast(new Float(value.floatValue()));
        }
        if (targetType.equals(Double.class)) {
            return targetType.cast(new Double(value.doubleValue()));
        }
        if (targetType.equals(BigDecimal.class)) {
            if (value instanceof Float || value instanceof Double) {
                return targetType.cast(new BigDecimal(value.toString()));
            }
            if (value instanceof BigInteger) {
                return targetType.cast(new BigDecimal((BigInteger)value));
            }
            if (value instanceof BigDecimal) {
                return targetType.cast(new BigDecimal(value.toString()));
            }
            return targetType.cast(BigDecimal.valueOf(value.longValue()));
        }
        if (targetType.equals(BigInteger.class)) {
            if (value instanceof BigDecimal) {
                return targetType.cast(((BigDecimal)value).toBigInteger());
            }
            return targetType.cast(BigInteger.valueOf(value.longValue()));
        }
        String msg = this.toString(this.getClass()) + " cannot handle conversion to '" + this.toString(targetType) + "'";
        if (this.log().isWarnEnabled()) {
            this.log().warn("    " + msg);
        }
        throw new ConversionException(msg);
    }
 -> java.lang.Object.getClass(): java.lang.Class -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Number.doubleValue(): double -> java.lang.Number.floatValue(): float -> java.lang.Class.cast(java.lang.Object): java.lang.Object
 [CALL] -> java.lang.Object.getClass(): java.lang.Class -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Object.equals(java.lang.Object): boolean -> java.lang.Number.doubleValue(): double -> java.lang.Number.floatValue(): float -> java.lang.Class.cast(java.lang.Object): java.lang.Object [EXIT]