We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
JDK 17
MVEL evaluates
obj.bigDecimalField = Long.valueOf('999999999999999999');
as 1000000000000000000
1000000000000000000
Example:
public void testBugReport () { final String bigValue = "999999999999999999"; MyObj obj = new MyObj(); final String expr = "obj.bigDecimalField = bigValue"; MVEL.eval(expr, Map.of("obj", obj, "bigValue", bigValue)); assertEquals(bigValue, obj.bigDecimalField.toString());// OK assertEquals(bigValue, new BigDecimal(Long.valueOf(bigValue).toString()).toString());// OK bug not in JDK MVEL.eval(expr, Map.of("obj", obj, "bigValue", Long.valueOf(bigValue))); assertEquals(bigValue, obj.bigDecimalField.toString());// Failure // Expected :999999999999999999 // Actual :1000000000000000000 } /** POJO for testing of copying values between Fields and domain objects */ public static class MyObj { BigDecimal bigDecimalField; BigInteger bigIntegerField; public void setBigDecimalField (BigDecimal v) { bigDecimalField = v;} public void setBigIntegerField (BigInteger v) { bigIntegerField = v;} }
The text was updated successfully, but these errors were encountered:
bug in MVEL: mvel/mvel#313
b027ef3
Any chance?
Sorry, something went wrong.
No branches or pull requests
JDK 17
MVEL evaluates
obj.bigDecimalField = Long.valueOf('999999999999999999');
as
1000000000000000000
Example:
The text was updated successfully, but these errors were encountered: