Skip to content

Commit

Permalink
chore: fixed some sonar issues
Browse files Browse the repository at this point in the history
Refs: XRDDEV-2628
  • Loading branch information
mloitm committed Oct 17, 2024
1 parent 94b9156 commit 9d0d868
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,15 @@ public SOAPMessage send(final SOAPMessage request, final String url) throws SOAP
LOGGER.error(ex.getMessage(), ex);
throw new XRd4JRuntimeException(ex.getMessage());
}
SOAPConnection connection = connectionFactory.createConnection();
LOGGER.debug(SEND_SOAP_TO, url);
LOGGER.trace("Outgoing SOAP request : \"{}\".", SOAPHelper.toString(request));
SOAPMessage response = connection.call(request, client);
LOGGER.debug("SOAP response received.");
LOGGER.trace("Incoming SOAP response : \"{}\".", SOAPHelper.toString(response));
connection.close();
return response;

try (SOAPConnection connection = connectionFactory.createConnection()) {
LOGGER.debug(SEND_SOAP_TO, url);
LOGGER.trace("Outgoing SOAP request : \"{}\".", SOAPHelper.toString(request));
SOAPMessage response = connection.call(request, client);
LOGGER.debug("SOAP response received.");
LOGGER.trace("Incoming SOAP response : \"{}\".", SOAPHelper.toString(response));
return response;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ private SOAPMessage processServiceRequest(ServiceRequest serviceRequest) {
}
} catch (XRd4JException ex) {
LOGGER.error(ex.getMessage(), ex);
if (serviceRequest.hasError()) {
if (serviceRequest != null && serviceRequest.hasError()) {
return this.errorToSOAP(this.cloneErrorMessage(serviceRequest.getErrorMessage()), null);
} else {
return this.errorToSOAP(this.errInternalServerErr, null);
Expand Down

0 comments on commit 9d0d868

Please sign in to comment.