From 2a1dda316f739cd80fae385e187870fc3c1ff00f Mon Sep 17 00:00:00 2001 From: alozano3 Date: Wed, 22 Mar 2023 16:56:10 +0100 Subject: [PATCH] fix sort contract error --- src/main/java/org/akhq/models/ConnectPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/akhq/models/ConnectPlugin.java b/src/main/java/org/akhq/models/ConnectPlugin.java index 8bbae8afe..bd8f0ab15 100644 --- a/src/main/java/org/akhq/models/ConnectPlugin.java +++ b/src/main/java/org/akhq/models/ConnectPlugin.java @@ -31,7 +31,8 @@ public ConnectPlugin(ConnectorPlugin connectorPlugin, ConnectorPluginConfigValid .map(config -> new Definition(config.getDefinition())), registryDefinition() ) - .sorted(Comparator.comparing(Definition::getGroup, (s1, s2) -> s1.equals("Others") ? 1 : s1.compareTo(s2)) + .sorted(Comparator.comparing(Definition::getGroup, Comparator.comparing((String s) -> s.equals("Others")) + .thenComparing(Comparator.naturalOrder())) .thenComparing(Definition::getOrder) ) .collect(Collectors.toList());