From edf40897db0c85f29a60f06cbd4bebf0f0bc17b6 Mon Sep 17 00:00:00 2001
From: alaskowski <alaskowski@ethz.ch>
Date: Wed, 4 Oct 2023 10:19:45 +0200
Subject: [PATCH] SSDM-55: Fixed properties setting to not trim data at the
 start

---
 .../server/dataaccess/EntityPropertiesConverter.java        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/EntityPropertiesConverter.java b/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/EntityPropertiesConverter.java
index f7c34cdc706..d3f66175125 100644
--- a/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/EntityPropertiesConverter.java
+++ b/server-application-server/source/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/EntityPropertiesConverter.java
@@ -336,12 +336,13 @@ public final class EntityPropertiesConverter implements IEntityPropertiesConvert
             }
         }
 
-        String propertyValue = value.toString().trim();
-        if(propertyValue.isEmpty()) {
+        String propertyValue = value.toString();
+        if(propertyValue.trim().isEmpty()) {
             return null;
         }
 
         if(propertyType.isMultiValue()) {
+            propertyValue = propertyValue.trim();
             propertyValue = stripBracketsIfPresent(propertyValue);
             if(propertyValue.isEmpty()) {
                 return null;
@@ -363,6 +364,7 @@ public final class EntityPropertiesConverter implements IEntityPropertiesConvert
             }
         } else {
             if(ARRAY_TYPES.contains(propertyType.getType().getCode())) {
+                propertyValue = propertyValue.trim();
                 propertyValue = stripBracketsIfPresent(propertyValue);
                 return Arrays.stream(propertyValue.split(regex))
                                     .map(String::trim)
-- 
GitLab