aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-04-23 08:32:22 +0200
committerBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-04-23 08:32:22 +0200
commit40da104bc021e0e4aab58f7c33c766afa1535b70 (patch)
tree361d0f1260bd4b6923ec354e964dec5ad2f83b5c
parent05744704372014b511b3c36c794a8c80bdd7a0bb (diff)
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 <bartosz.gardziejewski@nokia.com> Change-Id: If470a94fe4349759a46ac4ff70301c5bdddc619f
-rw-r--r--pnfsimulator/src/main/java/org/onap/pnfsimulator/simulator/client/utils/ssl/SslSupportLevel.java10
1 files changed, 9 insertions, 1 deletions
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;