diff options
author | Parshad Patel <pars.patel@samsung.com> | 2018-11-27 15:36:08 +0900 |
---|---|---|
committer | Tal Gitelman <tal.gitelman@att.com> | 2018-11-29 11:12:38 +0000 |
commit | 82c84075c71e285d1009bbe7e183ad2f0358d335 (patch) | |
tree | 93cd6a3c8b39318d63504a1abe0d34d096fe2f92 /catalog-be | |
parent | 55c897b36c7bf0f123e561e5f334ca4d7fcc14bb (diff) |
Fix critical sonar issues
Fix rethrow the "InterruptedException" and Use "isAssignableFrom" sonar issues
Issue-ID: SDC-1895
Change-Id: I2cadc08b9e7acdc84cf25a3ce9d22199711afa5d
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
Diffstat (limited to 'catalog-be')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/CambriaHandler.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/CambriaHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/CambriaHandler.java index 7d99563a76..359330b81d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/CambriaHandler.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/CambriaHandler.java @@ -473,6 +473,7 @@ public class CambriaHandler { } catch (InterruptedException e) { log.debug("Failed during sleep after sending the message.", e); + Thread.currentThread().interrupt(); } log.debug("After sending notification data to topic {}. result is {}", topicName, result); @@ -516,6 +517,7 @@ public class CambriaHandler { } catch (InterruptedException e) { log.debug("Failed during sleep after sending the message.", e); + Thread.currentThread().interrupt(); } log.debug("After sending notification data to topic {}. result is {}", topicName, result); @@ -546,7 +548,13 @@ public class CambriaHandler { response = new CambriaErrorResponse(CambriaOperationStatus.OK, 200); } } - catch (IOException | InterruptedException e) { + catch (InterruptedException e) { + log.debug("InterruptedException while closing cambria publisher", e); + Thread.currentThread().interrupt(); + response = new CambriaErrorResponse(CambriaOperationStatus.INTERNAL_SERVER_ERROR, 500); + writeErrorToLog(response, methodName, SEND_NOTIFICATION); + } + catch (IOException e) { log.debug("Failed to close cambria publisher", e); response = new CambriaErrorResponse(CambriaOperationStatus.INTERNAL_SERVER_ERROR, 500); writeErrorToLog(response, methodName, SEND_NOTIFICATION); |