Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1321

NameAbbreviator creates temporary objects

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5
    • 2.6
    • Pattern Converters
    • None

    Description

      PatternLayout's NamePatternConverter and ClassNamePatternConverter delegate to NameAbbreviator.

      The current API that NameAbbreviator supports is

      String abbreviate(String original)
      

      This creates temporary objects. However, the clients of NameAbbreviator already have a StringBuilder to write into. I propose to modify the NameAbbreviator API to this:

      void abbreviate(String original, StringBuilder destination)
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            rpopma Remko Popma
            rpopma Remko Popma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment