From c746eccb2ed447364ab105fc580c022ab0231562 Mon Sep 17 00:00:00 2001
From: Baptiste Toulemonde <toulemonde@cines.fr>
Date: Tue, 28 Jun 2022 17:22:52 +0200
Subject: [PATCH] fix exception thrown

---
 .../com/smartharvester/service/MappingService.java   | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/smartharvester/service/MappingService.java b/src/main/java/com/smartharvester/service/MappingService.java
index 0cf20f1..30ecb76 100644
--- a/src/main/java/com/smartharvester/service/MappingService.java
+++ b/src/main/java/com/smartharvester/service/MappingService.java
@@ -233,7 +233,9 @@ public class MappingService {
                                     values.add(value);
                                     propertyValueMap.replace(path.getProperty(), values);
                                 } else {
-                                    propertyValueMap.put(path.getProperty(), List.of(value));
+                                    List<String> values = new ArrayList<>();
+                                    values.add(value);
+                                    propertyValueMap.put(path.getProperty(), values);
                                 }
                                 break;
                             } else if (jsonT.optString(list.get(i)) != null && jsonT.has(list.get(i))) {
@@ -243,7 +245,9 @@ public class MappingService {
                                     values.add(value);
                                     propertyValueMap.replace(path.getProperty(), values);
                                 } else {
-                                    propertyValueMap.put(path.getProperty(), List.of(value));
+                                    List<String> values = new ArrayList<>();
+                                    values.add(value);
+                                    propertyValueMap.put(path.getProperty(), values);
                                 }
                                 break;
                             } else {
@@ -259,7 +263,9 @@ public class MappingService {
                                                 values.add(value);
                                                 propertyValueMap.replace(path.getProperty(), values);
                                             } else {
-                                                propertyValueMap.put(path.getProperty(), List.of(value));
+                                                List<String> values = new ArrayList<>();
+                                                values.add(value);
+                                                propertyValueMap.put(path.getProperty(), values);
                                             }
                                         }
 
-- 
GitLab