[
https://issues.apache.org/jira/browse/LANG-1454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18044856#comment-18044856
]
Gary D. Gregory edited comment on LANG-1454 at 12/13/25 12:43 PM:
------------------------------------------------------------------
This was solved at some point; the current code only accesses
{{useShortClassName}} from the getter and setter.
was (Author: garydgregory):
This was solve at some point, the current code only accesses
{{useShortClassName}} from the getter and setter.
> ToStringStyle.appendClassName() should use isUseShortClassName()
> ----------------------------------------------------------------
>
> Key: LANG-1454
> URL: https://issues.apache.org/jira/browse/LANG-1454
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.builder.*
> Affects Versions: 3.8.1
> Reporter: Giorgio Vespucci
> Priority: Major
> Fix For: 3.20.0
>
>
> I tried to implement a custom {{ToStringStyle}} and I wanted to get the short
> class name in the printed text. My first thought was to override the method
> {{isUseShortClassName}} in the subclass to make it returns always {{true}},
> but unexpectedly this didn't work, as the {{protected}} method
> {{appendClassName(final StringBuffer buffer, final Object object)}} doesn't
> use the boolean getter and directly access the {{private boolean
> useShortClassName}} member.
> I think the {{appendClassName}} method should act the same way, for example,
> the method {{appendIdentityHashCode}} does, i.e. accessing the {{private
> boolean useIdentityHashCode}} by its getter.
> Thank you.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)