summaryrefslogtreecommitdiffstats
path: root/ms/neng/src/main/java
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-12-03 16:00:48 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-12-03 16:01:10 +0530
commit10abe761bed97607d59a6f113dfd766d6c411105 (patch)
tree3a8284271ec91400830a694c970ab6e9e0fbf2c3 /ms/neng/src/main/java
parent409a44b5b0b510af613e2036712c340486bae410 (diff)
fixed sonar issues in RestServiceImpl.java
fixed sonar issues Issue-ID: CCSDK-525 Change-Id: I2f37d883df71b48daa0f0daf8b57d3c609889a52 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'ms/neng/src/main/java')
-rw-r--r--ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/rs/RestServiceImpl.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/rs/RestServiceImpl.java b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/rs/RestServiceImpl.java
index e52e0016..3746756e 100644
--- a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/rs/RestServiceImpl.java
+++ b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/rs/RestServiceImpl.java
@@ -42,7 +42,9 @@ import org.springframework.web.bind.annotation.RequestBody;
public class RestServiceImpl implements RestService {
private static Logger log = Logger.getLogger(RestServiceImpl.class.getName());
private static final String INTERNAL_ERROR_MSG = "Internal error occured while processing the request.";
-
+ private static final String ERROR="error";
+
+
@Autowired SpringService service;
/**
@@ -67,11 +69,11 @@ public class RestServiceImpl implements RestService {
return buildResponse(resp);
} catch (NengException e) {
log.warning(e.getMessage());
- response.put("error", buildErrorResponse("NELGEN-0003", e.getMessage()));
+ response.put(ERROR, buildErrorResponse("NELGEN-0003", e.getMessage()));
return buildErrorResponse(response);
} catch (Exception e) {
log.warning(e.getMessage());
- response.put("error", buildErrorResponse("err-0500", INTERNAL_ERROR_MSG));
+ response.put(ERROR, buildErrorResponse("err-0500", INTERNAL_ERROR_MSG));
return buildErrorResponse(response);
}
}
@@ -88,11 +90,11 @@ public class RestServiceImpl implements RestService {
return buildResponse(resp);
} catch (NengException e) {
log.warning(e.getMessage());
- response.put("error", buildErrorResponse("NELGEN-0002", e.getMessage()));
+ response.put(ERROR, buildErrorResponse("NELGEN-0002", e.getMessage()));
return buildErrorResponse(response);
} catch (Exception e) {
log.warning(e.getMessage());
- response.put("error", buildErrorResponse("err-0500", INTERNAL_ERROR_MSG));
+ response.put(ERROR, buildErrorResponse("err-0500", INTERNAL_ERROR_MSG));
return buildErrorResponse(response);
}
}
@@ -120,7 +122,7 @@ public class RestServiceImpl implements RestService {
return buildResponse(response);
} catch (Exception e) {
log.warning(e.getMessage());
- response.put("error", buildErrorResponse("err-0500", e.getMessage()));
+ response.put(ERROR, buildErrorResponse("err-0500", e.getMessage()));
return buildErrorResponse(response);
}
}