You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bs...@apache.org on 2019/10/16 16:48:09 UTC

[geode] 01/01: GEODE-7311: log message is missing arguments

This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch feature/GEODE-7311
in repository https://gitbox.apache.org/repos/asf/geode.git

commit c523738fce8eb064383670d6adc042c04c351444
Author: Bruce Schuchardt <bs...@pivotal.io>
AuthorDate: Wed Oct 16 09:44:20 2019 -0700

    GEODE-7311: log message is missing arguments
    
    use String.format() to construct the error message
---
 .../main/java/org/apache/geode/internal/tcp/Connection.java  | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java b/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java
index c8b1fed..e268e37 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java
@@ -3309,17 +3309,15 @@ public class Connection implements Runnable {
           return;
         default:
           String err =
-              "Unknown handshake reply code: %s nioMessageLength: %s";
-          Object[] errArgs = new Object[] {this.replyCode,
-              messageLength};
+              String.format("Unknown handshake reply code: %s nioMessageLength: %s", this.replyCode,
+                  this.messageLength);
           if (replyCode == 0 && logger.isDebugEnabled()) { // bug 37113
-            logger.debug(
-                String.format(err, errArgs) + " (peer probably departed ungracefully)");
+            logger.debug(err + " (peer probably departed ungracefully)");
           } else {
-            logger.fatal(err, errArgs);
+            logger.fatal(err);
           }
           this.readerShuttingDown = true;
-          requestClose(String.format(err, errArgs));
+          requestClose(err);
           return;
       }
     } catch (Exception e) {