[
https://issues.apache.org/jira/browse/JEXL-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Henri Biestro resolved JEXL-436.
--------------------------------
Resolution: Fixed
Commit
[9fc51924|https://github.com/apache/commons-jexl/commit/9fc51924b13b62e73e7e4ee0e90e7c99dc2ea2c9]
> The increment (decrement) operator does not check for null operand
> ------------------------------------------------------------------
>
> Key: JEXL-436
> URL: https://issues.apache.org/jira/browse/JEXL-436
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 3.4.1
> Reporter: Vincent Bussol
> Assignee: Henri Biestro
> Priority: Major
> Fix For: 3.4.1
>
>
> Using the default arithmetic (strict):
>
> {code:java}
> var i = null;
> ++i;{code}
> The operation returns 1 when it should fail. Same behavior for all version of
> increment/decrement operators. The other operators (like add or self add)
> throw an error "variable 'i' is null" as expected.
>
>
> {code:java}
> @Test
> void testStrictIncrementOperatorOnNull() {
> final JexlEngine jexl = new JexlBuilder().create();
> JexlScript script = jexl.createScript("var i = null; ++i");
> assertThrows(JexlException.class, () -> script.execute(null));
> } {code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)