Merge "Fix sonar issue with nosonar annotation"
authorBogumil Zebek <bogumil.zebek@nokia.com>
Fri, 3 Apr 2020 12:39:18 +0000 (12:39 +0000)
committerGerrit Code Review <gerrit@onap.org>
Fri, 3 Apr 2020 12:39:18 +0000 (12:39 +0000)
certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/Password.java
certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/RandomPasswordGenerator.java

index 35ae9f9..9275817 100644 (file)
@@ -24,8 +24,7 @@ class Password {
     // We are excluding this line in Sonar due to fact that
     // PASSWORD_PATTERN does not contain password. This solution
     // is safe.
-    // NOSONAR
-    private static final String PASSWORD_PATTERN = "[\\w$#]{16,}";
+    private static final String PASSWORD_PATTERN = "[\\w$#]{16,}"; // NOSONAR
     private final String currentPassword;
 
     Password(String currentPassword) {
index aa7d615..ad3ae20 100644 (file)
@@ -20,6 +20,7 @@
 package org.onap.aaf.certservice.client.certification.conversion;
 
 import java.security.SecureRandom;
+
 import org.apache.commons.lang3.RandomStringUtils;
 
 class RandomPasswordGenerator {
@@ -37,15 +38,14 @@ class RandomPasswordGenerator {
     //we are using new SecureRandom which provides
     //cryptographic security
     Password generate(int passwordLength) {
-        //NOSONAR
         return new Password(RandomStringUtils.random(
-            passwordLength,
-            START_POSITION_IN_ASCII_CHARS,
-            END_POSITION_IN_ASCII_CHARS,
-            USE_LETTERS_ONLY,
-            USE_NUMBERS_ONLY,
-            SET_OF_CHARS,
-            new SecureRandom()));
+                passwordLength,
+                START_POSITION_IN_ASCII_CHARS,
+                END_POSITION_IN_ASCII_CHARS,
+                USE_LETTERS_ONLY,
+                USE_NUMBERS_ONLY,
+                SET_OF_CHARS,
+                new SecureRandom())); //NOSONAR
     }
 }