Changeset 6193e48 for router


Ignore:
Timestamp:
Feb 12, 2018 6:49:01 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
507c1d5
Parents:
1826fce
Message:

Util: Add sort methods that catch IAE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java

    r1826fce r6193e48  
    99import java.util.concurrent.ConcurrentHashMap;
    1010
     11import net.i2p.data.DataHelper;
    1112import net.i2p.data.Hash;
    1213import net.i2p.data.i2np.I2NPMessage;
     
    383384                            // for several minutes.
    384385                            boolean preferEmpty = _context.random().nextInt(4) != 0;
    385                             try {
    386                                 Collections.sort(wanted, new TunnelPoolComparator(preferEmpty));
    387                             } catch (IllegalArgumentException iae) {
    388                                 // Java 7 TimSort - see info in TunnelPoolComparator
    389                                 continue;
    390                             }
     386                            // Java 7 TimSort - see info in TunnelPoolComparator
     387                            DataHelper.sort(wanted, new TunnelPoolComparator(preferEmpty));
    391388                        }
    392389
Note: See TracChangeset for help on using the changeset viewer.