You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (JIRA)" <ji...@apache.org> on 2019/01/11 16:06:00 UTC

[jira] [Resolved] (JEXL-285) For statement variable may seem unaffected by iteration

     [ https://issues.apache.org/jira/browse/JEXL-285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro resolved JEXL-285.
--------------------------------
    Resolution: Fixed

- Detect reuse of local variable in 'for' statements at parsing time

https://github.com/apache/commons-jexl/commit/889b4b01e7998c485661eca4eb3159fbe1840a5e

> For statement variable may seem unaffected by iteration
> -------------------------------------------------------
>
>                 Key: JEXL-285
>                 URL: https://issues.apache.org/jira/browse/JEXL-285
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Henri Biestro
>            Assignee: Henri Biestro
>            Priority: Major
>             Fix For: 3.2
>
>
> When a 'for' loop uses a global variable (as in (for c: ...)), if a local variable with that name has been declared previously, the global variable is nevertheless used for iteration. Since the local variable is preferred during resolution in statements within the loop, the iteration does not change the variable value.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)