From 40da104bc021e0e4aab58f7c33c766afa1535b70 Mon Sep 17 00:00:00 2001 From: Bartosz Gardziejewski Date: Thu, 23 Apr 2020 08:32:22 +0200 Subject: Add string formatter to error message Logger.error is seen by sonar as bug due to message formatting. To resolve this issue formatting was extracted to previous line. Issue-ID: INT-1533 Signed-off-by: Bartosz Gardziejewski Change-Id: If470a94fe4349759a46ac4ff70301c5bdddc619f --- .../simulator/client/utils/ssl/SslSupportLevel.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/client/utils/ssl/SslSupportLevel.java b/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/client/utils/ssl/SslSupportLevel.java index 2325ebc..fb3b958 100644 --- a/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/client/utils/ssl/SslSupportLevel.java +++ b/pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/client/utils/ssl/SslSupportLevel.java @@ -68,7 +68,15 @@ public enum SslSupportLevel { .build(); } catch (GeneralSecurityException e) { - LOGGER.error("Could not initialize client due to SSL exception: {}. Default client without SSL support will be used instead.\nCause: {}", e.getMessage(), e.getCause()); + String errorMessage = + String.format( + "Could not initialize client due to SSL exception: %s. " + + "Default client without SSL support will be used instead." + + "\nCause: %s", + e.getMessage(), + e.getCause() + ); + LOGGER.error(errorMessage, e); client = NONE.getClient(requestConfig, sslAuthenticationHelper); } return client; -- cgit 1.2.3-korg