From 8a2255ac90dd1e8204f8f4238d8dd892ed702b91 Mon Sep 17 00:00:00 2001 From: Shadowrs Date: Fri, 14 Sep 2018 13:16:30 +0100 Subject: [PATCH] [Bugfix] Fix ServerDescription to use proper compare() to prevent conflict with matching names, authors and versions --- src/main/java/org/parabot/core/desc/ServerDescription.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/parabot/core/desc/ServerDescription.java b/src/main/java/org/parabot/core/desc/ServerDescription.java index a32695c..dcae4c8 100644 --- a/src/main/java/org/parabot/core/desc/ServerDescription.java +++ b/src/main/java/org/parabot/core/desc/ServerDescription.java @@ -39,7 +39,10 @@ public class ServerDescription implements Comparable { @Override public int compareTo(ServerDescription o) { if (this.getServerName().equalsIgnoreCase(o.getServerName())) { - return 1; + if (getAuthor().equals(o.getAuthor())) { + return Double.compare(o.getRevision(), getRevision()); + } + return getAuthor().compareTo(o.getAuthor()); } return this.getServerName().compareTo(o.getServerName()); }