[
https://issues.apache.org/jira/browse/JEXL-453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Henri Biestro resolved JEXL-453.
--------------------------------
Resolution: Fixed
Thank you for the report; fixed
[5d47e7|https://github.com/apache/commons-jexl/commit/5d47e727a6999de4036f540d608ec1ec22e2d00a]
> Finally clause is not evaluated
> -------------------------------
>
> Key: JEXL-453
> URL: https://issues.apache.org/jira/browse/JEXL-453
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 3.6.1
> Reporter: Vincent Bussol
> Assignee: Henri Biestro
> Priority: Critical
>
> When a catch clause is present and no error occurs, the finally clause is not
> evaluated.
> {code:java}
> try {
> // do stuff; do not raise an error
> } catch (const xerror) {
> // manage error
> } finally {
> // not evaluated
> }{code}
> Here is a simple test:
> {code:java}
> @Test
> void testTryCatchFinally() {
> final String src = "try { return 42 } catch(const xerror){} finally {
> return 169 }";
> final JexlScript script = JEXL.createScript(src);
> assertNotNull(script);
> final Object result = script.execute(null);
> assertEquals(169, result);
> } {code}
> I think that in the method {_}Interpreter#visit(final ASTTryStatement node,
> final Object data){_}, the child offset is not updated correctly and the
> finally block (node) is actually the catch variable.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)