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:05:26 UTC

[groovy] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/groovy.git


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

commit 36a593170eef7c1c800b4d76249fceb3ac200032
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] }
         }
     }