summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src
diff options
context:
space:
mode:
authorr.bogacki <r.bogacki@samsung.com>2019-05-23 14:59:56 +0200
committerRobert Bogacki <r.bogacki@samsung.com>2019-06-10 10:10:23 +0000
commit90f12676cced89d4b3426b2b86a681322f7ceb5c (patch)
tree8a279049540c78f7ea515d5cf3b5c793b10b9082 /ecomp-portal-BE-common/src
parent29d3b52d6146d69c939079a665d8cccd0d243561 (diff)
Sonar critical fixes in MicroserviceServiceImpl
Fixed critical issues according to the Sonar analysis: -Fixed imports. -Fixed logical comparisons. Issue-ID: PORTAL-591 Signed-off-by: Robert Bogacki <r.bogacki@samsung.com> Change-Id: Icc2b6fb45777582486e1060245cdf94e4f6d685d
Diffstat (limited to 'ecomp-portal-BE-common/src')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java
index e90aeb74..6c9161df 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java
@@ -4,6 +4,8 @@
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
@@ -42,8 +44,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javax.crypto.BadPaddingException;
-
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.onap.portalapp.portal.domain.MicroserviceData;
@@ -196,7 +196,7 @@ public class MicroserviceServiceImpl implements MicroserviceService {
private String decryptedPassword(String encryptedPwd) throws Exception {
String result = "";
- if (encryptedPwd != null & encryptedPwd.length() > 0) {
+ if (encryptedPwd != null && !encryptedPwd.isEmpty()) {
try {
result = CipherUtil.decryptPKC(encryptedPwd,
SystemProperties.getProperty(SystemProperties.Decryption_Key));
@@ -210,7 +210,7 @@ public class MicroserviceServiceImpl implements MicroserviceService {
private String encryptedPassword(String decryptedPwd) throws Exception {
String result = "";
- if (decryptedPwd != null & decryptedPwd.length() > 0) {
+ if (decryptedPwd != null && !decryptedPwd.isEmpty()) {
try {
result = CipherUtil.encryptPKC(decryptedPwd,
SystemProperties.getProperty(SystemProperties.Decryption_Key));