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

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

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2
    • 2.3
    • Core
    • None

    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

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

          People

            Unassigned Unassigned
            ggregory Gary D. Gregory
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment