Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1454

ToStringStyle.appendClassName() should use isUseShortClassName()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.8.1
    • None
    • lang.builder.*
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gvespucci Giorgio Vespucci
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: