summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk
diff options
context:
space:
mode:
authorburdziak <olaf.burdziakowski@nokia.com>2019-05-15 15:31:20 +0200
committerburdziak <olaf.burdziakowski@nokia.com>2019-05-15 15:31:20 +0200
commit68eabf669e4c83bd669286900e8a6f77e4009f29 (patch)
tree60fd9b844b126b9412d0dbe555c83c3148d26a17 /ecomp-sdk
parent94a4107912cc984d10a67ae9e2d09234b85cff22 (diff)
Fix sonar issues
Change-Id: Ia104ca24015784ad0f733f27f5f69dec9b8562e0 Issue-ID: PORTAL-523 Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
Diffstat (limited to 'ecomp-sdk')
-rw-r--r--ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java
index 19bec306..f5d37e2b 100644
--- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java
+++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileSearchController.java
@@ -72,6 +72,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
public class ProfileSearchController extends RestrictedBaseController {
private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ProfileSearchController.class);
+
+ private static final String APPLICATION_JSON = "application/json";
@Autowired
private UserProfileService service;
@@ -107,7 +109,7 @@ public class ProfileSearchController extends RestrictedBaseController {
profileList = service.findAll();
JsonMessage msg = new JsonMessage(mapper.writeValueAsString(profileList));
JSONObject j = new JSONObject(msg);
- response.setContentType("application/json");
+ response.setContentType(APPLICATION_JSON);
response.getWriter().write(j.toString());
} catch (Exception e) {
logger.error(EELFLoggerDelegate.applicationLogger, "getUser failed", e);
@@ -131,7 +133,7 @@ public class ProfileSearchController extends RestrictedBaseController {
model.put("profileList", mapper.writeValueAsString(profileList));
JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
JSONObject j = new JSONObject(msg);
- response.setContentType("application/json");
+ response.setContentType(APPLICATION_JSON);
response.getWriter().write(j.toString());
} catch (Exception e) {
logger.error(EELFLoggerDelegate.applicationLogger, "getUserPagination failed", e);
@@ -139,7 +141,8 @@ public class ProfileSearchController extends RestrictedBaseController {
}
@SuppressWarnings("unchecked")
- private Map<String, Object> setDashboardData(HttpServletRequest request) throws Exception {
+ private Map<String, Object> setDashboardData(HttpServletRequest request)
+ throws com.fasterxml.jackson.core.JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> model = new HashMap<>();
List<List<MenuData>> childItemList = new ArrayList<>();
@@ -170,7 +173,7 @@ public class ProfileSearchController extends RestrictedBaseController {
logger.info(EELFLoggerDelegate.auditLogger,
"Change active status for user " + user.getId() + " to " + user.getActive());
ObjectMapper mapper = new ObjectMapper();
- response.setContentType("application/json");
+ response.setContentType(APPLICATION_JSON);
PrintWriter out = response.getWriter();
out.write(mapper.writeValueAsString(user.getActive()));
} catch (Exception e) {