Re: LANG-378: Indented formatting for ToStringBuilder

Toolforger <[email protected]> Sun, 10 May 2026 13:49:17 +0200
Newsgroups gmane.comp.jakarta.commons.devel
Message-ID <[email protected]>
Am 10.05.26 um 13:17 schrieb Gary Gregory:
> On Sun, May 10, 2026, 06:51 Elliotte Rusty Harold <[email protected]>
> wrote:
> 
>> On Sun, May 10, 2026 at 12:36 AM Gary Gregory <[email protected]>
>> wrote:
>>>
>>> Hello Jo,
>>>
>>> I don't think anything like this should be added to Lang. That part of
>> the
>>> library is a mini-framework that apps can use to suit their needs. We
>>> should not start accumulating more implementations than we already have.
>>>
>>
>> Makes sense. Can you close the issue as won't fix then?
> 
> Closed.

I was preparing an answer that explores possible consensus based on 
experiments, code analysis, and improving understanding, but I see I was 
wasting my time as there was a predefined consensus already.

Since

1) RecursiveToStringStyle might have worked but fails for unrelated 
reasons (try using it with a java.nio.Path instance in a Java that 
enforces module boundaries for hilarious results: it tries to pick up a 
static field which is nonsensical *and* deep dives into JDK internals 
because it ignores the existence of the explicit UnixPath#toString() 
implementation),
2) MULTI_LINE_STRING_STYLE just creates unreadable output (see below), and
3) the commons-lang project seems to default to fending off suggestions 
rather than exploring them (which I find understandable but still 
frustrating),

I'm off to explore alternatives such as YAML output.
It's grossly overengineered for the task but at least I see a way forward.

-Jo

Here's what MULTI_LINE_STYLE will give me for small configuration data:

 > org.toolforger.websitebuilder.config.MainConfig@2ef9b8bc[
 >   buildDir=websites.out
 >   websites=[org.toolforger.websitebuilder.config.WebsiteConfig@5315b42e[
 >   srcDir=websites.in
 > 
serverConfig=org.toolforger.websitebuilder.config.ServerConfig@77b52d12[
 >   host=www382.your-server.de
 >   username=XXX
 >   privateSshKey=/home/jo/.ssh/id_rsa
 >   password=
 > ]
 >   destDir=public_html
 > 
directories={websites.in=org.toolforger.websitebuilder.config.DirectoryConfig@2096442d[
 >   isWebroot=false
 >   css=
 >   favicon=
 >   logo=
 >   fsEntries=[]
 > ], 
websites.in/durchholz.org=org.toolforger.websitebuilder.config.DirectoryConfig@234bef66[
 >   isWebroot=true
 >   css=websites.in/durchholz.org/css
 >   favicon=websites.in/durchholz.org/favicon
 >   logo=websites.in/durchholz.org/jd-glyph-outlined.png
 >   fsEntries=[]
 > ], 
websites.in/durchholz.org/essays=org.toolforger.websitebuilder.config.DirectoryConfig@61dc03ce[
 >   isWebroot=false
 >   css=
 >   favicon=
 >   logo=
 >   fsEntries=[org.toolforger.websitebuilder.config.FsEntry@50f8360d[
 >   FsName=websites.in/durchholz.org/essays/handmade-passwords.adoc
 >   title=Onepager (en)
 >   processor=
 > ], org.toolforger.websitebuilder.config.FsEntry@2cb4c3ab[
 >   FsName=websites.in/durchholz.org/essays/design-by-contract.adoc
 >   title=Onepager (en)
 >   processor=
 > ]]
 > ], 
websites.in/durchholz.org/favicons=org.toolforger.websitebuilder.config.DirectoryConfig@13c78c0b[
 >   isWebroot=false
 >   css=
 >   favicon=
 >   logo=
 >   fsEntries=[]
 > ], 
websites.in/durchholz.org/hiring=org.toolforger.websitebuilder.config.DirectoryConfig@12843fce[
 >   isWebroot=false
 >   css=
 >   favicon=
 >   logo=
 >   fsEntries=[org.toolforger.websitebuilder.config.FsEntry@3dd3bcd[
 >   FsName=websites.in/durchholz.org/hiring/Joachim Durchholz - CV.de.odt
 >   title=CV (de)
 >   processor=
 > ], org.toolforger.websitebuilder.config.FsEntry@337d0578[
 >   FsName=websites.in/durchholz.org/hiring/Joachim Durchholz - 
Troubleshooter Role.en.adoc
 >   title=Onepager (en)
 >   processor=
 > ]]
 > ], 
websites.in/toolforger.org=org.toolforger.websitebuilder.config.DirectoryConfig@59e84876[
 >   isWebroot=true
 >   css=websites.in/toolforger.org/css
 >   favicon=websites.in/toolforger.org/favicon
 >   logo=
 >   fsEntries=[]
 > ], 
websites.in/toolforger.org.old=org.toolforger.websitebuilder.config.DirectoryConfig@61a485d2[
 >   isWebroot=false
 >   css=
 >   favicon=
 >   logo=
 >   fsEntries=[]
 > ], 
websites.in/toolforger.org.old/website=org.toolforger.websitebuilder.config.DirectoryConfig@39fb3ab6[
 >   isWebroot=false
 >   css=
 >   favicon=
 >   logo=
 >   fsEntries=[]
 > ], 
websites.in/toolforger.org/favicon=org.toolforger.websitebuilder.config.DirectoryConfig@7946e1f4[
 >   isWebroot=false
 >   css=
 >   favicon=
 >   logo=
 >   fsEntries=[]
 > ]}
 > ]]
 > ]