Skip to content

Commit

Permalink
Fix some sonar findings
Browse files Browse the repository at this point in the history
Fix some sonar findings
  • Loading branch information
strailov authored Jun 30, 2023
2 parents 150de47 + ad3404c commit a8d5a15
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,14 @@ public String constructActionMessage() {
final String remarkMessage = StringUtils.hasText(remark) ? remark : "n/a";
final String formattedInitiator = StringUtils.hasText(initiator) ? initiator : "n/a";
final String createdByRolloutsUser = StringUtils.hasText(getCreatedBy()) ? getCreatedBy() : "n/a";
return String.format("Assignment automatically confirmed by initiator '%s'. \n\n" //
+ "Auto confirmation activated by system user: '%s' \n\n" //
+ "Remark: %s", formattedInitiator, createdByRolloutsUser, remarkMessage);
// https://docs.oracle.com/en/java/javase/17/text-blocks/index.html#normalization-of-line-terminators
// nevertheless of the end of line of the file (\r\n, \n or \r) the result will contains \n
return """
Assignment automatically confirmed by initiator '%s'.\040
Auto confirmation activated by system user: '%s'\040
Remark: %s""".formatted(formattedInitiator, createdByRolloutsUser, remarkMessage);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public Object getPreAuthenticatedCredentials(final DmfTenantSecurityToken securi
* if we find the hash in any the trusted CA chain to accept this request for
* this tenant.
*/
@SuppressWarnings("java:S2629") // check if debug is enabled is maybe heavier then evaluation
private String getIssuerHashHeader(final DmfTenantSecurityToken securityToken, final String knownIssuerHashes) {
// there may be several knownIssuerHashes configured for the tenant
final List<String> knownHashes = splitMultiHashBySemicolon(knownIssuerHashes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ private int getInProgressCount() {
return inProgressCount;
}

@SuppressWarnings("java:S2629") // error shall be enable almost every time and evaluation is light
private static void assertFileStateConsistency(final int inProgressCount, final int overallUploadCount,
final int succeededUploadCount, final int failedUploadCount) {
if (inProgressCount < 0) {
Expand Down

0 comments on commit a8d5a15

Please sign in to comment.