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

Andres Almiray updated GROOVY-8149:
-----------------------------------
    Affects Version/s: 3.0.4

> Bad Compiler Performance in case of syntax errors when using many subscript 
> operators
> -------------------------------------------------------------------------------------
>
>                 Key: GROOVY-8149
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8149
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.3.7, 2.5.0-alpha-1, 2.4.10, 3.0.4
>         Environment: Windows 7
>            Reporter: Ivo Colombo
>            Priority: Minor
>
> See the following script with a Syntax error (unbalanced parentheses), which 
> repeatedly uses the subscript operator to set something on an object which 
> has the putAt method defined:
> {code}
> class A {
>       void putAt(key, value) {
>               // whatever
>       }
> }
> def a = new A()
> a[1] = (
> a[2] = 2
> a[3] = 3
> a[4] = 4
> a[5] = 5
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> a[1] = 0
> {code}
> Expected: The compiler returns with a syntax error.
> Observed: The script takes very long (in the order of minutes) to compile. If 
> it is shortened (remove some of the assignments), at some point it compiles 
> within reasonable time (< 1 Minute), but still slow. The syntax error is 
> reported correctly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to