From 4dfdbee2c1d34f0f6584d624a213fc44389cd430 Mon Sep 17 00:00:00 2001 From: AvinashS Date: Mon, 16 Oct 2017 12:36:29 +0530 Subject: Fix sonar critical Change-Id: Ibdcda7db910e343dba0b5f5e6da7a0db201eee0e IssueId: VNFSDK-113 Signed-off-by: AvinashS --- csarvalidation/src/main/java/org/onap/validation/csar/CsarUtil.java | 2 +- .../src/main/java/org/onap/validation/csar/CsarValidator.java | 6 +++--- .../src/main/java/org/onap/validation/csar/ValidationException.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/csarvalidation/src/main/java/org/onap/validation/csar/CsarUtil.java b/csarvalidation/src/main/java/org/onap/validation/csar/CsarUtil.java index 850ccdd..c498479 100644 --- a/csarvalidation/src/main/java/org/onap/validation/csar/CsarUtil.java +++ b/csarvalidation/src/main/java/org/onap/validation/csar/CsarUtil.java @@ -135,7 +135,7 @@ public class CsarUtil { outputStream.close(); } } catch (Exception e1) { - logger.error("FILE_IO" + ":" + "close OutputStream error! " +ErrorCodes.FILE_IO); + logger.error("FILE_IO" + ":" + "close OutputStream error! " +ErrorCodes.FILE_IO, e1); throw new ValidationException(ErrorCodes.FILE_IO); } diff --git a/csarvalidation/src/main/java/org/onap/validation/csar/CsarValidator.java b/csarvalidation/src/main/java/org/onap/validation/csar/CsarValidator.java index 24969e7..9ca9c26 100644 --- a/csarvalidation/src/main/java/org/onap/validation/csar/CsarValidator.java +++ b/csarvalidation/src/main/java/org/onap/validation/csar/CsarValidator.java @@ -52,7 +52,7 @@ public class CsarValidator { try(FileInputStream is = new FileInputStream(csarWithPath)) { } catch (FileNotFoundException e2) { - LOG.error("CSAR %s is not found! " +ErrorCodes.RESOURCE_MISSING); + LOG.error("CSAR %s is not found! " +ErrorCodes.RESOURCE_MISSING, e2); throw new ValidationException(ErrorCodes.RESOURCE_MISSING); } @@ -153,7 +153,7 @@ public class CsarValidator { return true; } } catch (IOException e2) { - LOG.error("CSAR_META_VALIDATION" + ":" + "Exception caught while validateCsarMeta ! " +ErrorCodes.FILE_IO); + LOG.error("CSAR_META_VALIDATION" + ":" + "Exception caught while validateCsarMeta ! " +ErrorCodes.FILE_IO, e2); throw new ValidationException(ErrorCodes.FILE_IO); } } @@ -198,7 +198,7 @@ public class CsarValidator { } } } catch (IOException | NullPointerException e) { - LOG.error("CSAR_TOSCA_VALIDATION" + ":" + "Could not read file %s ! " +ErrorCodes.FILE_IO+ " " +ErrorCodes.RESOURCE_MISSING); + LOG.error("CSAR_TOSCA_VALIDATION" + ":" + "Could not read file %s ! " +ErrorCodes.FILE_IO+ " " +ErrorCodes.RESOURCE_MISSING, e); throw new ValidationException(ErrorCodes.RESOURCE_MISSING); } return false; diff --git a/csarvalidation/src/main/java/org/onap/validation/csar/ValidationException.java b/csarvalidation/src/main/java/org/onap/validation/csar/ValidationException.java index 5a3230b..ec0c45c 100644 --- a/csarvalidation/src/main/java/org/onap/validation/csar/ValidationException.java +++ b/csarvalidation/src/main/java/org/onap/validation/csar/ValidationException.java @@ -54,7 +54,7 @@ public class ValidationException extends RuntimeException { } private ErrorCodes errorCode; - private final Map properties = new TreeMap(); + private final transient Map properties = new TreeMap(); public ValidationException(ErrorCodes fileIo) { this.errorCode = fileIo; -- cgit 1.2.3-korg