You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2022/07/04 04:06:23 UTC

[groovy] branch GROOVY_4_0_X updated: GROOVY-6871: Running :show all command multiple times throws StackOverflowError

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/GROOVY_4_0_X by this push:
     new 557a5eeb92 GROOVY-6871: Running :show all command multiple times throws StackOverflowError
557a5eeb92 is described below

commit 557a5eeb92ccbcc9fab294ad6c7447bb059bf05b
Author: Paul King <pa...@asert.com.au>
AuthorDate: Mon Jul 4 14:05:16 2022 +1000

    GROOVY-6871: Running :show all command multiple times throws StackOverflowError
---
 .../groovy/org/apache/groovy/groovysh/commands/ShowCommand.groovy     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/commands/ShowCommand.groovy b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/commands/ShowCommand.groovy
index 56f49b67b0..aded00fae3 100644
--- a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/commands/ShowCommand.groovy
+++ b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/commands/ShowCommand.groovy
@@ -49,8 +49,8 @@ class ShowCommand extends ComplexCommandSupport {
                     value = "method ${value.method}()"
                 }
 
-                io.out.println("  $key = ${FormatHelper.toString(value)}")
-            }
+                io.out.println("  $key = ${FormatHelper.toString(safe: true, maxSize: 2000, value)}")
+            }.collectEntries { k, v -> [k, k == '_' ? k : v] }
         }
     }