diff --git a/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigUtils.java b/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigUtils.java index 5923c5c84927f..787af1ecf8279 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigUtils.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/configuration/ConfigUtils.java @@ -183,7 +183,7 @@ public OptionalInt getPriority() { @SuppressWarnings("unchecked") public static SmallRyeConfigBuilder configBuilder(SmallRyeConfigBuilder builder, List configBuilders) { - configBuilders.sort(Comparator.comparing(ConfigBuilder::priority)); + configBuilders.sort(ConfigBuilderComparator.INSTANCE); for (ConfigBuilder configBuilder : configBuilders) { builder = configBuilder.configBuilder(builder); @@ -333,4 +333,17 @@ public Set getPropertyNames() { return Collections.emptySet(); } } + + private static class ConfigBuilderComparator implements Comparator { + + private static final ConfigBuilderComparator INSTANCE = new ConfigBuilderComparator(); + + private ConfigBuilderComparator() { + } + + @Override + public int compare(ConfigBuilder o1, ConfigBuilder o2) { + return Integer.compare(o1.priority(), o2.priority()); + } + } }