diff options
author | Dan Timoney <dtimoney@att.com> | 2018-12-03 19:42:02 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-12-03 19:42:02 +0000 |
commit | 7ba2b41df853c5163568a8ce548e2cad2af21b23 (patch) | |
tree | f002b115fbf9ea5e94cac0c735614aa276626ddd /ms/neng/src | |
parent | 5310a39e93317431d0bfb0a16771f08a208429be (diff) | |
parent | 10abe761bed97607d59a6f113dfd766d6c411105 (diff) |
Merge "fixed sonar issues in RestServiceImpl.java"
Diffstat (limited to 'ms/neng/src')
-rw-r--r-- | ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/service/rs/RestServiceImpl.java | 14 |
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); } } |