Changeset 363aaadb
- Timestamp:
- Jun 2, 2018 12:28:50 PM (3 years ago)
- Branches:
- master
- Children:
- 06106c75
- Parents:
- 7713284
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/routerconsole/java/src/net/i2p/router/web/helpers/TunnelRenderer.java
r7713284 r363aaadb 211 211 public int compare(HopConfig l, HopConfig r) { 212 212 return (r.getProcessedMessagesCount() - l.getProcessedMessagesCount()); 213 } 214 } 215 216 /** @since 0.9.35 */ 217 private static class TunnelInfoComparator implements Comparator<TunnelInfo>, Serializable { 218 public int compare(TunnelInfo l, TunnelInfo r) { 219 long le = l.getExpiration(); 220 long re = r.getExpiration(); 221 if (le < re) 222 return -1; 223 if (le > re) 224 return 1; 225 return 0; 213 226 } 214 227 } … … 248 261 249 262 private void renderPool(Writer out, TunnelPool in, TunnelPool outPool) throws IOException { 250 List<TunnelInfo> tunnels = null; 251 if (in == null) 263 Comparator<TunnelInfo> comp = new TunnelInfoComparator(); 264 List<TunnelInfo> tunnels; 265 if (in == null) { 252 266 tunnels = new ArrayList<TunnelInfo>(); 253 else267 } else { 254 268 tunnels = in.listTunnels(); 255 if (outPool != null) 256 tunnels.addAll(outPool.listTunnels()); 269 Collections.sort(tunnels, comp); 270 } 271 if (outPool != null) { 272 List<TunnelInfo> otunnels = outPool.listTunnels(); 273 Collections.sort(otunnels, comp); 274 tunnels.addAll(otunnels); 275 } 257 276 258 277 long processedIn = (in != null ? in.getLifetimeProcessed() : 0);
Note: See TracChangeset
for help on using the changeset viewer.