Giorgio Vespucci created LANG-1454:
--------------------------------------
Summary: 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
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
(v7.6.3#76005)