From ebb18f0fad7e13356f15fd5d0fa132b9656af87c Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Sun, 31 Oct 2021 20:37:06 -0300 Subject: [PATCH] Using StringBuilder instead of concatenating Strings --- .../vertx/http/runtime/VertxHttpRecorder.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java index 0c178bd3400ac..52599772a388d 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/VertxHttpRecorder.java @@ -575,30 +575,30 @@ public void handle(AsyncResult event) { private static void setHttpServerTiming(InsecureRequests insecureRequests, HttpServerOptions httpServerOptions, HttpServerOptions sslConfig, HttpServerOptions domainSocketOptions, boolean auxiliaryApplication) { - String serverListeningMessage = "Listening on: "; + StringBuilder serverListeningMessage = new StringBuilder("Listening on: "); int socketCount = 0; if (httpServerOptions != null && !InsecureRequests.DISABLED.equals(insecureRequests)) { - serverListeningMessage += String.format( - "http://%s:%s", httpServerOptions.getHost(), actualHttpPort); + serverListeningMessage.append(String.format( + "http://%s:%s", httpServerOptions.getHost(), actualHttpPort)); socketCount++; } if (sslConfig != null) { if (socketCount > 0) { - serverListeningMessage += " and "; + serverListeningMessage.append(" and "); } - serverListeningMessage += String.format("https://%s:%s", sslConfig.getHost(), actualHttpsPort); + serverListeningMessage.append(String.format("https://%s:%s", sslConfig.getHost(), actualHttpsPort)); socketCount++; } if (domainSocketOptions != null) { if (socketCount > 0) { - serverListeningMessage += " and "; + serverListeningMessage.append(" and "); } - serverListeningMessage += String.format("unix:%s", domainSocketOptions.getHost()); + serverListeningMessage.append(String.format("unix:%s", domainSocketOptions.getHost())); } - Timing.setHttpServer(serverListeningMessage, auxiliaryApplication); + Timing.setHttpServer(serverListeningMessage.toString(), auxiliaryApplication); } /**