From 8efeec5a9b2ee58f04adda9eca6d1313a4a142fc Mon Sep 17 00:00:00 2001
From: itsKedar <37594766+itsKedar@users.noreply.github.com>
Date: Thu, 1 Aug 2024 12:02:30 +0530
Subject: [PATCH] Added Similarity ID to new Line
---
pom.xml | 2 +-
src/main/java/com/checkmarx/sdk/service/CxService.java | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index a900c0de..0a2069fc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
com.github.checkmarx-ltd
cx-spring-boot-sdk
- 0.6.12
+ 0.6.13
cx-spring-boot-sdk
diff --git a/src/main/java/com/checkmarx/sdk/service/CxService.java b/src/main/java/com/checkmarx/sdk/service/CxService.java
index a29fb490..1e5e8be8 100644
--- a/src/main/java/com/checkmarx/sdk/service/CxService.java
+++ b/src/main/java/com/checkmarx/sdk/service/CxService.java
@@ -1202,7 +1202,9 @@ private void prepareIssuesRemoveDuplicates(List cxIssueList,
String newIssueDescription = issue.getDescription();
String existingSimilarityId = existingIssue.getSimilarityId();
String newSimilarityId = issue.getSimilarityId();
- existingIssue.setSimilarityId(existingSimilarityId + ", " + newSimilarityId);
+ if((existingSimilarityId!=null) && (!existingSimilarityId.contains(newSimilarityId))){
+ existingIssue.setSimilarityId(existingSimilarityId + ", " + newSimilarityId);
+ }
if (!existingIssueDescription.contains(newIssueDescription)) {
stringBuilder.append(existingIssueDescription).append("\r\n").append("\r\n").append(newIssueDescription);
cxIssueList.get(cxIssueList.indexOf(issue)).setDescription(stringBuilder.toString());