From 619cb7327b46ee31b4041942f67648e01cb3260d Mon Sep 17 00:00:00 2001 From: Sascha Bieberstein Date: Mon, 16 Oct 2023 16:17:35 +0200 Subject: [PATCH] Sorts component conf files in the correct order These need to be reversed as `withFallback` is used for each config. This means that only properties that are missing in the first one are taken from the second one and so on. Fixes: SIRI-891 --- src/main/java/sirius/kernel/Sirius.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/sirius/kernel/Sirius.java b/src/main/java/sirius/kernel/Sirius.java index 7567e143..02b17770 100644 --- a/src/main/java/sirius/kernel/Sirius.java +++ b/src/main/java/sirius/kernel/Sirius.java @@ -31,6 +31,7 @@ import java.time.Duration; import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -346,7 +347,7 @@ private static void setupApplicationAndSystemConfig() { // Load test configurations (will override component configs) classpath.find(Pattern.compile("component-test-([^.]*?)\\.conf")) .map(Matcher::group) - .sorted() + .sorted(Comparator.reverseOrder()) .forEach(configPath -> { try { LOG.INFO("Loading test config: %s", configPath); @@ -361,7 +362,7 @@ private static void setupApplicationAndSystemConfig() { classpath.find(Pattern.compile("component-([^\\-]*?)([^.]*?)\\.conf")) .map(Matcher::group) .filter(configPath -> !"test".equals(configPath)) - .sorted() + .sorted(Comparator.reverseOrder()) .forEach(configPath -> { try { LOG.INFO("Loading config: %s", configPath);