summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoredyta <edyta.krukowska@nokia.com>2020-04-03 10:39:03 +0200
committeredyta <edyta.krukowska@nokia.com>2020-04-03 10:39:03 +0200
commit3716dd1f9d12c78ba7224f073915475e686923a9 (patch)
treeaf25276881748b0c1f7d273eddaeb771107e64df
parentfa33d3f9cf9b613968bf277284841164d392fc21 (diff)
Fix sonar issue with nosonar annotation
Issue-ID: AAF-1118 Signed-off-by: Edyta Krukowska <edyta.krukowska@nokia.com> Change-Id: Ibcde00c211e3ab1965c576c7d2436d2d9869482b
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/Password.java3
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/RandomPasswordGenerator.java16
2 files changed, 9 insertions, 10 deletions
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/Password.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/Password.java
index 35ae9f96..9275817d 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/Password.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/Password.java
@@ -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) {
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/RandomPasswordGenerator.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/RandomPasswordGenerator.java
index aa7d6151..ad3ae208 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/RandomPasswordGenerator.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/conversion/RandomPasswordGenerator.java
@@ -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
}
}