From 171ec7b74a11658277f9e9fe1dcc893a8225db9e Mon Sep 17 00:00:00 2001 From: seshukm Date: Tue, 12 Sep 2017 16:13:47 +0530 Subject: Fix for SONAR critical issues Issue-Id : SO-117 Change-Id: Icdc64605b475e20af7e871135af327f7d0e38792 Signed-off-by: seshukm --- .../main/java/org/openecomp/mso/apihandlerinfra/ManualTasks.java | 3 ++- .../src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java | 3 ++- .../org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java | 3 ++- .../java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java | 3 ++- .../main/java/org/openecomp/mso/apihandlerinfra/TasksHandler.java | 6 +++--- 5 files changed, 11 insertions(+), 7 deletions(-) (limited to 'mso-api-handlers/mso-api-handler-infra') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ManualTasks.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ManualTasks.java index acdae29256..f3273cf144 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ManualTasks.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ManualTasks.java @@ -3,6 +3,7 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -190,7 +191,7 @@ public class ManualTasks { completeResp = mapper.writeValueAsString(trr); } catch (Exception e) { - msoLogger.debug("Unable to format response"); + msoLogger.debug("Unable to format response",e); Response resp = msoRequest.buildServiceErrorResponse(bpelStatus, MsoException.ServiceException, "Request Failed due to bad response format" , diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java index e7a2334f9c..eab232d4d5 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/MsoRequest.java @@ -3,6 +3,7 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -215,7 +216,7 @@ public class MsoRequest { requestJSON = mapper.writeValueAsString(sir.getRequestDetails()); } catch(Exception e){ - throw new ValidationException ("Parse ServiceInstanceRequest to JSON string"); + throw new ValidationException ("Parse ServiceInstanceRequest to JSON string",e); } if(instanceIdMap != null){ diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java index a176f6996d..26fdba47c4 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java @@ -3,6 +3,7 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -343,7 +344,7 @@ public class OrchestrationRequests { requestDetails = mapper.readValue(requestBody, RequestDetails.class); }catch(Exception e){ - msoLogger.debug("Exception caught mapping requestBody to RequestDetails"); + msoLogger.debug("Exception caught mapping requestBody to RequestDetails",e); } request.setRequestDetails(requestDetails); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java index a196cc0b8d..e32f1535d4 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/ServiceInstances.java @@ -3,6 +3,7 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -649,7 +650,7 @@ public class ServiceInstances { msoRequest.updateFinalStatus (Status.FAILED); msoLogger.error (MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "", MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine"); msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine"); - msoLogger.debug ("End of the transaction, the final response is: " + (String) resp.getEntity ()); + msoLogger.debug ("End of the transaction, the final response is: " + (String) resp.getEntity (),e); return resp; } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/TasksHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/TasksHandler.java index b191a3d767..1e8bea0c55 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/TasksHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/TasksHandler.java @@ -164,7 +164,7 @@ public class TasksHandler { msoRequest.updateFinalStatus (Status.FAILED); msoLogger.error (MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "", MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine"); msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine"); - msoLogger.debug ("End of the transaction, the final response is: " + (String) resp.getEntity ()); + msoLogger.debug ("End of the transaction, the final response is: " + (String) resp.getEntity (),e); return resp; } TasksGetResponse trr = new TasksGetResponse(); @@ -206,7 +206,7 @@ public class TasksHandler { msoLogger.error (MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "", MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine"); msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine"); - msoLogger.debug ("End of the transaction, the final response is: " + (String) resp.getEntity ()); + msoLogger.debug ("End of the transaction, the final response is: " + (String) resp.getEntity (),e); return resp; } taskList.add(taskListEntry); @@ -235,7 +235,7 @@ public class TasksHandler { jsonResponse = mapper.writeValueAsString(trr); } catch (Exception e) { - msoLogger.debug("Unable to format response"); + msoLogger.debug("Unable to format response",e); Response resp = msoRequest.buildServiceErrorResponse(500, MsoException.ServiceException, "Request Failed due to bad response format" , -- cgit 1.2.3-korg