|| literalValue.indexOf('e') > -1
|| literalValue.indexOf('E') > -1)
{
// if it coerces to double, then it's a double
Number value = ((LiteralType)type).coerceToNumber(Double.class);
return new FloatLiteralType(-1 * value.doubleValue());
}
// if it coerces to long, then it's a long
Number value = ((LiteralType)type).coerceToNumber(Long.class);
return new IntegerLiteralType(-1 * value.longValue());
}
// otherwise, just return a long typed value
return new ValueType(Signature.SIG_LONG, IAssignable.ASSIGNMENT_TYPE_RHS);
}
// JSP.2.3.5.4
// big integer and big decimal retain type
// all numeric types retain type
if (TypeCoercer.typeIsNumeric(boxedType))
{
// integer and float literals are special because -1 or -1.0
// is syntically minusOp(1) and minusOp(1.0)
if (type instanceof IntegerLiteralType)
{
return new IntegerLiteralType(-1 * ((IntegerLiteralType)type).coerceToNumber(Long.class).longValue());
}
else if (type instanceof FloatLiteralType)
{
return new FloatLiteralType(-1 * ((FloatLiteralType)type).coerceToNumber(Double.class).doubleValue());
}
return type;
}
// all other cases, return null