diff options
author | Harry Huang <huangxiangyu5@huawei.com> | 2017-09-16 16:48:55 +0800 |
---|---|---|
committer | Harry Huang <huangxiangyu5@huawei.com> | 2017-09-16 17:51:07 +0800 |
commit | 536e714bae755a0bfa8eb88064fbaac24afb05cd (patch) | |
tree | 019c0b196250374e6673ae2b5ecfb86ad1f2f60e | |
parent | 1fb8387b7dc59a9ac62ef7c9b592197687818554 (diff) |
fix patch 2
major: L133 L170
critical: L115 L175
Change-Id: I0a116d160763edb86a3abfb4633487971c7e9a93
Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
Issue-Id: VNFSDK-85
-rw-r--r-- | vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java | 10 |
1 files changed, 4 insertions, 6 deletions
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<PackageData> packageList = new ArrayList<PackageData>(); + ArrayList<PackageData> 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; } |