From 56554f0ce3bdc78f1e5b134a8dc2fcac9eca6f0e Mon Sep 17 00:00:00 2001
From: felmer <franz-josef.elmer@id.ethz.ch>
Date: Wed, 16 Jan 2019 11:08:14 +0100
Subject: [PATCH] SSDM-7430: fixing bug in UpdateAttachmentForEntityExecutor:
 Order of attachments are not controlled because of HashSet

---
 .../executor/attachment/UpdateAttachmentForEntityExecutor.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/attachment/UpdateAttachmentForEntityExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/attachment/UpdateAttachmentForEntityExecutor.java
index 175a566b948..c2e637392e8 100644
--- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/attachment/UpdateAttachmentForEntityExecutor.java
+++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/attachment/UpdateAttachmentForEntityExecutor.java
@@ -20,6 +20,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Set;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -73,7 +74,7 @@ public class UpdateAttachmentForEntityExecutor implements IUpdateAttachmentForEn
     @SuppressWarnings("unchecked")
     private void add(IOperationContext context, AttachmentHolderPE attachmentHolder, AttachmentListUpdateValue updates)
     {
-        Set<AttachmentCreation> added = new HashSet<AttachmentCreation>();
+        Set<AttachmentCreation> added = new LinkedHashSet<AttachmentCreation>();
 
         for (ListUpdateAction<?> action : updates.getActions())
         {
-- 
GitLab