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

org.apache.logging.log4j.core.net.ssl.TlsSyslogInputStreamReader does not need to create temp Integer objects

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Description

      org.apache.logging.log4j.core.net.ssl.TlsSyslogInputStreamReader does not need to create temp Integer objects.

      diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TlsSyslogInputStreamReader.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TlsSyslogInputStreamReader.java
      index 4622dd0..8ea3142 100644
      --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TlsSyslogInputStreamReader.java
      +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/TlsSyslogInputStreamReader.java
      @@ -86,6 +86,6 @@
       
           private void calculateNextMessageLength() {
               final byte[] length = Arrays.copyOfRange(lengthBuffer, 0, position);
      -        nextMessageLength = new Integer(new String(length));
      +        nextMessageLength = Integer.parseInt(new String(length));
           }
       }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              garydgregory Gary Gregory
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: