diff --git a/src/freenet/clients/http/DarknetConnectionsToadlet.java b/src/freenet/clients/http/DarknetConnectionsToadlet.java index ef0bc025d6..9021189d7d 100644 --- a/src/freenet/clients/http/DarknetConnectionsToadlet.java +++ b/src/freenet/clients/http/DarknetConnectionsToadlet.java @@ -41,20 +41,20 @@ protected class DarknetComparator extends ComparatorByStatus { @Override protected int customCompare(PeerNodeStatus firstNode, PeerNodeStatus secondNode, String sortBy) { - switch (sortBy) { - case "name": - return ((DarknetPeerNodeStatus) firstNode).getName().compareToIgnoreCase(((DarknetPeerNodeStatus) secondNode).getName()); - case "privnote": - return ((DarknetPeerNodeStatus) firstNode).getPrivateDarknetCommentNote().compareToIgnoreCase(((DarknetPeerNodeStatus) secondNode).getPrivateDarknetCommentNote()); - case "trust": - return ((DarknetPeerNodeStatus) firstNode).getTrustLevel().compareTo(((DarknetPeerNodeStatus) secondNode).getTrustLevel()); - case "visibility": - int ret = ((DarknetPeerNodeStatus) firstNode).getOurVisibility().compareTo(((DarknetPeerNodeStatus) secondNode).getOurVisibility()); - if (ret != 0) return ret; - return ((DarknetPeerNodeStatus) firstNode).getTheirVisibility().compareTo(((DarknetPeerNodeStatus) secondNode).getTheirVisibility()); - default: - return super.customCompare(firstNode, secondNode, sortBy); - } + switch (sortBy) { + case "name": + return ((DarknetPeerNodeStatus) firstNode).getName().compareToIgnoreCase(((DarknetPeerNodeStatus) secondNode).getName()); + case "privnote": + return ((DarknetPeerNodeStatus) firstNode).getPrivateDarknetCommentNote().compareToIgnoreCase(((DarknetPeerNodeStatus) secondNode).getPrivateDarknetCommentNote()); + case "trust": + return ((DarknetPeerNodeStatus) firstNode).getTrustLevel().compareTo(((DarknetPeerNodeStatus) secondNode).getTrustLevel()); + case "visibility": + int ret = ((DarknetPeerNodeStatus) firstNode).getOurVisibility().compareTo(((DarknetPeerNodeStatus) secondNode).getOurVisibility()); + if (ret != 0) return ret; + return ((DarknetPeerNodeStatus) firstNode).getTheirVisibility().compareTo(((DarknetPeerNodeStatus) secondNode).getTheirVisibility()); + default: + return super.customCompare(firstNode, secondNode, sortBy); + } } /** Default comparison, after taking into account status */