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

Questionable code in AbstractStringLayout.serializeToBytes()

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 2.13.1
    • 2.13.2
    • Layouts
    • None

    Description

      Source from current master:

      protected byte[] serializeToBytes(final Serializer serializer, final byte[] defaultValue) {
          final String serializable = serializeToString(serializer);
          if (serializer == null) {
              return defaultValue;
          }
          return StringEncoder.toBytes(serializable, getCharset());
      }
      

      I believe the test should be on "serializable" not "serializer".

       

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            kdgregory Keith D Gregory
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment