-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downcasting from Object to BigDecimal incorrectly uses Number#longValue #217
Comments
Without EPL I cannot understand what you are saying |
Event class: MyEvent myEvent = new MyEvent(); then sendEventBean ... EPL: The result is 156 instead of 156.78 Decimal places will be lost in this case, because used BigDecLongCaster instead of BigDecDoubleCaster. esper version 8.6.0 |
I think you are saying that downcasting from Object to BigDecimal incorrectly uses Number#longValue? |
Yes |
Possibly related to #202? |
} else if (targetType.getType() == BigDecimal.class) { return (SimpleTypeCaster)(JavaClassHelper.isFloatingPointClass(fromType) ? SimpleTypeCasterFactory.BigDecDoubleCaster.INSTANCE : SimpleTypeCasterFactory.BigDecLongCaster.INSTANCE); } else {
public static boolean isFloatingPointClass(Class<?> clazz) { return clazz == Float.class || clazz == Double.class || clazz == Float.TYPE || clazz == Double.TYPE; }
The text was updated successfully, but these errors were encountered: