From 4d906526962eb14202c3a9b3e980b9cca48fc784 Mon Sep 17 00:00:00 2001 From: seoyeon chae <83562035+che-so@users.noreply.github.com> Date: Wed, 4 Oct 2023 17:19:50 +0900 Subject: [PATCH] Remove v from OSS Version --- .../controller/ProjectController.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/oss/fosslight/controller/ProjectController.java b/src/main/java/oss/fosslight/controller/ProjectController.java index cc1843b58..8d3f736c6 100644 --- a/src/main/java/oss/fosslight/controller/ProjectController.java +++ b/src/main/java/oss/fosslight/controller/ProjectController.java @@ -1910,7 +1910,14 @@ private Map updateCopyConfirmStatus(HttpServletRequest req, Proj ossComponents = (List) fromJson(mainDataString, collectionType2); List> ossComponentsLicense = CommonFunction.setOssComponentLicense(ossComponents); - + for(ProjectIdentification idx : ossComponents){ + String ossVersion = idx.getOssVersion(); + if (ossVersion.matches("[vV]\\.(\\d+).*") || ossVersion.matches("[vV](\\d+).*")) { + ossVersion = ossVersion.replaceAll("[vV]\\.", "").replaceAll("[vV]", ""); + idx.setOssVersion(ossVersion); + } + } + Type collectionType4 = new TypeToken>() { }.getType(); List binAddList = new ArrayList(); @@ -2176,7 +2183,15 @@ private Map updateCopyConfirmStatus(HttpServletRequest req, Proj ossComponents = (List) fromJson(mainDataString, collectionType2); List> ossComponentsLicense = CommonFunction.setOssComponentLicense(ossComponents); - + + for(ProjectIdentification idx : ossComponents){ + String ossVersion = idx.getOssVersion(); + if (ossVersion.matches("[vV]\\.(\\d+).*") || ossVersion.matches("[vV](\\d+).*")) { + ossVersion = ossVersion.replaceAll("[vV]\\.", "").replaceAll("[vV]", ""); + idx.setOssVersion(ossVersion); + } + } + Type collectionType4 = new TypeToken>() {}.getType(); List srcAddList = new ArrayList(); srcAddList = (List) fromJson(srcAddListDataString, collectionType4);