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

Paul King resolved GROOVY-6871.
-------------------------------
    Fix Version/s: 5.0.0-alpha-1
                   4.0.4
         Assignee: Paul King
       Resolution: Fixed

We haven't progressed detecting printing mutually recursive structures yet. I 
implemented a workaround for this case in the meantime. It simply avoids 
including the '_' value in the variables returned by {{:show all}} as shown 
here:

{noformat}
Groovy Shell (5.0.0-SNAPSHOT, JVM: 17.0.2)
Type ':help' or ':h' for help.
-------------------------------------------------------------------------------
groovy:000> :show all
No variables defined
No classes have been loaded
No custom imports have been defined
No preferences are set
===> [null, null, null, null]
groovy:000> :show all
Variables:
  _ = [null, null, null, null]
No classes have been loaded
No custom imports have been defined
No preferences are set
===> [[_:_], null, null, null]
groovy:000> :show all
Variables:
  _ = [[_:_], null, null, null]
No classes have been loaded
No custom imports have been defined
No preferences are set
===> [[_:_], null, null, null]
groovy:000> :show all
Variables:
  _ = [[_:_], null, null, null]
No classes have been loaded
No custom imports have been defined
No preferences are set
===> [[_:_], null, null, null]
groovy:000>
{noformat}

> Running :show all command throws StackOverflowError
> ---------------------------------------------------
>
>                 Key: GROOVY-6871
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6871
>             Project: Groovy
>          Issue Type: Bug
>          Components: Groovysh
>    Affects Versions: 2.3.2, 2.4.0-beta-1
>         Environment: Windows 7
>            Reporter: Alexandre Rafalovitch
>            Assignee: Paul King
>            Priority: Minor
>              Labels: StackOverflowError
>             Fix For: 5.0.0-alpha-1, 4.0.4
>
>
> {quote}
> E:\Downloads\groovy-2.4.0-beta-1>bin\groovysh
> Groovy Shell (2.4.0-beta-1, JVM: 1.7.0_25)
> Type ':help' or ':h' for help.
> -----------------------------------------------------------
> groovy:000> :show all
> No variables defined
> No classes have been loaded
> No custom imports have been defined
> No preferences are set
> ===> [null, null, null, null]
> groovy:000> :show all
> Variables:
>   _ = [null, null, null, null]
> No classes have been loaded
> No custom imports have been defined
> No preferences are set
> ===> [[_:[null, null, null, null]], null, null, null]
> groovy:000> :show all
> Variables:
> ERROR java.lang.StackOverflowError:
> null
> groovy:000> :show all
> Variables:
> ERROR java.lang.StackOverflowError:
> null
> groovy:000>
> {quote}
> Can also be triggered faster by starting a recording session.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to