From 1dba20361861c9165ccff904c4b327ec47a3d3cc Mon Sep 17 00:00:00 2001 From: JordenReuter <149687553+JordenReuter@users.noreply.github.com> Date: Tue, 5 Mar 2024 18:17:04 +0100 Subject: [PATCH] fix: changed HashSet to LinkedHashSet to keep order (#29) --- .../product/store/bff/rs/mappers/MicrofrontendsMapper.java | 3 ++- .../onecx/product/store/bff/rs/mappers/ProductsMapper.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/tkit/onecx/product/store/bff/rs/mappers/MicrofrontendsMapper.java b/src/main/java/org/tkit/onecx/product/store/bff/rs/mappers/MicrofrontendsMapper.java index ebd8867..296f41e 100644 --- a/src/main/java/org/tkit/onecx/product/store/bff/rs/mappers/MicrofrontendsMapper.java +++ b/src/main/java/org/tkit/onecx/product/store/bff/rs/mappers/MicrofrontendsMapper.java @@ -2,6 +2,7 @@ import java.util.Arrays; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.Set; import java.util.stream.Collectors; @@ -32,7 +33,7 @@ public interface MicrofrontendsMapper { default Set map(String classifications) { if (classifications != null && !classifications.isBlank()) { String[] values = classifications.split(","); - return new HashSet<>(Arrays.asList(values)); + return new LinkedHashSet<>(Arrays.asList(values)); } else return new HashSet<>(); } diff --git a/src/main/java/org/tkit/onecx/product/store/bff/rs/mappers/ProductsMapper.java b/src/main/java/org/tkit/onecx/product/store/bff/rs/mappers/ProductsMapper.java index f44050b..816156e 100644 --- a/src/main/java/org/tkit/onecx/product/store/bff/rs/mappers/ProductsMapper.java +++ b/src/main/java/org/tkit/onecx/product/store/bff/rs/mappers/ProductsMapper.java @@ -40,7 +40,7 @@ default Set workspaceNames(WorkspacePageResult result) { default Set map(String classifications) { if (classifications != null && !classifications.isBlank()) { String[] values = classifications.split(","); - return new HashSet<>(Arrays.asList(values)); + return new LinkedHashSet<>(Arrays.asList(values)); } else return new HashSet<>(); }