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
.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;