From 0ccf1606946a13f2a1c1893df3bba2efb1e1e8d3 Mon Sep 17 00:00:00 2001
From: Isha Kumari <isha.kumari@ibm.com>
Date: Thu, 21 Nov 2024 08:24:04 +0000
Subject: [PATCH] When we attempt to retrieve a legal tag for a specific
 data-partition ID that contains a hyphen (-), we are unable to fetch the
 data.

---
 .../osdu/legal/ibm/tags/CloudantLegalTagRepository.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantLegalTagRepository.java b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantLegalTagRepository.java
index d4bac36e7..c53e01e8a 100644
--- a/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantLegalTagRepository.java
+++ b/provider/legal-ibm/src/main/java/org/opengroup/osdu/legal/ibm/tags/CloudantLegalTagRepository.java
@@ -356,7 +356,7 @@ public class CloudantLegalTagRepository implements ILegalTagRepository {
 			legalTags = allDocResponse.getResponse().getDocsAs(BanckendLegalTag.class)
 					.stream()
 					.filter(lTag ->  lTag.getIs_Valid() == args.getIsValid())
-					.filter(f->f.getName().split("-")[0].equalsIgnoreCase(headers.getPartitionId()))
+					.filter(f->f.getName().length() > headers.getPartitionId().length() && f.getName().substring(0,headers.getPartitionId().length()).equalsIgnoreCase(headers.getPartitionId()))
 					.collect(Collectors.toList());
 
 		} catch (IOException e) {
-- 
GitLab