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

Questionable code in AbstractStringLayout.serializeToBytes()

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.13.1
    • Fix Version/s: 2.13.2
    • Component/s: Layouts
    • Labels:
      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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: