From 4d986a7b29c00867dfff8fb5fe4f37524278fadb Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 16 Jan 2013 12:17:40 +0100 Subject: [PATCH] =?utf8?q?Replace=20utils=E2=80=99=20ReverseComparator=20b?= =?utf8?q?y=20Guava=E2=80=99s=20Ordering.reverse().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java b/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java index bc928c4..d001ea7 100644 --- a/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java +++ b/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java @@ -25,7 +25,6 @@ import java.util.List; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.web.page.FreenetRequest; import net.pterodactylus.util.collection.Pagination; -import net.pterodactylus.util.collection.ReverseComparator; import net.pterodactylus.util.number.Numbers; import net.pterodactylus.util.template.Template; import net.pterodactylus.util.template.TemplateContext; @@ -33,6 +32,7 @@ import net.pterodactylus.util.template.TemplateContext; import com.google.common.base.Predicate; import com.google.common.base.Predicates; import com.google.common.collect.Collections2; +import com.google.common.collect.Ordering; /** * This page shows all known Sones. @@ -117,25 +117,25 @@ public class KnownSonesPage extends SoneTemplatePage { List sortedSones = new ArrayList(knownSones); if ("activity".equals(sortField)) { if ("asc".equals(sortOrder)) { - Collections.sort(sortedSones, new ReverseComparator(Sone.LAST_ACTIVITY_COMPARATOR)); + Collections.sort(sortedSones, Ordering.from(Sone.LAST_ACTIVITY_COMPARATOR).reverse()); } else { Collections.sort(sortedSones, Sone.LAST_ACTIVITY_COMPARATOR); } } else if ("posts".equals(sortField)) { if ("asc".equals(sortOrder)) { - Collections.sort(sortedSones, new ReverseComparator(Sone.POST_COUNT_COMPARATOR)); + Collections.sort(sortedSones, Ordering.from(Sone.POST_COUNT_COMPARATOR).reverse()); } else { Collections.sort(sortedSones, Sone.POST_COUNT_COMPARATOR); } } else if ("images".equals(sortField)) { if ("asc".equals(sortOrder)) { - Collections.sort(sortedSones, new ReverseComparator(Sone.IMAGE_COUNT_COMPARATOR)); + Collections.sort(sortedSones, Ordering.from(Sone.IMAGE_COUNT_COMPARATOR).reverse()); } else { Collections.sort(sortedSones, Sone.IMAGE_COUNT_COMPARATOR); } } else { if ("desc".equals(sortOrder)) { - Collections.sort(sortedSones, new ReverseComparator(Sone.NICE_NAME_COMPARATOR)); + Collections.sort(sortedSones, Ordering.from(Sone.NICE_NAME_COMPARATOR).reverse()); } else { Collections.sort(sortedSones, Sone.NICE_NAME_COMPARATOR); } -- 2.7.4