import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.logging.Logger.getLogger;
+import static net.pterodactylus.sone.data.PostKt.newestPostFirst;
+import static net.pterodactylus.sone.data.ReplyKt.newestReplyFirst;
import static net.pterodactylus.sone.data.SoneKt.*;
import java.net.MalformedURLException;
synchronized (this) {
sortedPosts = new ArrayList<>(posts);
}
- Collections.sort(sortedPosts, Post.NEWEST_FIRST);
+ sortedPosts.sort(newestPostFirst());
return sortedPosts;
}
hash.putString(")", UTF_8);
List<PostReply> replies = new ArrayList<>(getReplies());
- Collections.sort(replies, Reply.TIME_COMPARATOR);
+ replies.sort(newestReplyFirst().reversed());
hash.putString("Replies(", UTF_8);
for (PostReply reply : replies) {
hash.putString("Reply(", UTF_8).putString(reply.getId(), UTF_8).putString(")", UTF_8);