From 536e714bae755a0bfa8eb88064fbaac24afb05cd Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Sat, 16 Sep 2017 16:48:55 +0800 Subject: fix patch 2 major: L133 L170 critical: L115 L175 Change-Id: I0a116d160763edb86a3abfb4633487971c7e9a93 Signed-off-by: Harry Huang Issue-Id: VNFSDK-85 --- .../onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'vnfmarket-be') diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java index a763a361..1955f4d3 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java @@ -113,7 +113,7 @@ public class PackageWrapperUtil { result = PackageManager.getInstance().queryPackageByCsarId(csarId).get(0); } } catch (MarketplaceResourceException e1) { - LOG.error("query package by csarId from db error ! " + e1.getMessage()); + LOG.error("query package by csarId from db error ! " + e1.getMessage(), e1); } return result; } @@ -130,12 +130,10 @@ public class PackageWrapperUtil { PackageMeta packageMeta = new PackageMeta(); long size = getPacakgeSize(fileLocation); packageMeta.setFormat(basic.getFormat()); - String usedPackageId = null; + String usedPackageId = packageId; if(null == packageId) { usedPackageId = ToolUtil.generateId(); - } else { - usedPackageId = packageId; } packageMeta.setCsarId(usedPackageId); @@ -167,13 +165,13 @@ public class PackageWrapperUtil { * @return download uri */ public static String getPackagePath(String csarId) { - ArrayList packageList = new ArrayList(); + ArrayList packageList = new ArrayList<>(); String downloadUri = null; try { packageList = PackageManager.getInstance().queryPackageByCsarId(csarId); downloadUri = packageList.get(0).getDownloadUri(); } catch (MarketplaceResourceException e1) { - LOG.error("Query CSAR package by ID failed ! csarId = " + csarId); + LOG.error("Query CSAR package by ID failed ! csarId = " + csarId, e1); } return downloadUri; } -- cgit 1.2.3-korg