You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2026/03/31 14:57:00 UTC

[jira] [Created] (GROOVY-11893) Standardise hooks for Groovy pretty printing

Paul King created GROOVY-11893:
----------------------------------

             Summary: Standardise hooks for Groovy pretty printing
                 Key: GROOVY-11893
                 URL: https://issues.apache.org/jira/browse/GROOVY-11893
             Project: Groovy
          Issue Type: Improvement
            Reporter: Paul King
            Assignee: Paul King


Groovy has special hard-coded handling when printing lists, maps and in some cases arrays. There have been proposals for disabling this, e.g. part of:

https://github.com/apache/groovy/pull/566

This issue is to look at a more general approach to handling such cases including the ability to disable the special handling and fall back to JDK default formatting for e.g. maps.

The idea that will be explored is to have groovyToString extension methods. They would encode the current hard-coded formatting behavior. These extensions could be disabled using the groovy.extension.disable system property to fall back to JDK defaults.

Note that currently not all paths funnel through a single path that we can fix using this mechanism. Printing some objects through inspect does things like limit length and escape backslashes etc. Currently, we don't try to force those through this mechanism.



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