Changeset 8845ce6


Ignore:
Timestamp:
Jun 15, 2014 4:14:13 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
3e54b5d
Parents:
ff189e7
Message:

Findbugs all over:

Files:
49 edited

Legend:

Unmodified
Added
Removed
  • apps/addressbook/java/src/net/i2p/addressbook/Servlet.java

    rff189e7 r8845ce6  
    4242 */
    4343public class Servlet extends HttpServlet {
    44     private DaemonThread thread;
     44
     45    private static final long serialVersionUID = 1L;
     46    private transient DaemonThread thread;
    4547    //private String nonce;
    4648    //private static final String PROP_NONCE = "addressbook.nonce";
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    rff189e7 r8845ce6  
    88import java.io.IOException;
    99import java.io.OutputStream;
     10import java.io.Serializable;
    1011import java.util.ArrayList;
    1112import java.util.Arrays;
     
    19701971     *  @since 0.9
    19711972     */
    1972     private static class IgnoreCaseComparator implements Comparator<Tracker> {
     1973    private static class IgnoreCaseComparator implements Comparator<Tracker>, Serializable {
    19731974        public int compare(Tracker l, Tracker r) {
    19741975            return l.name.toLowerCase().compareTo(r.name.toLowerCase());
  • apps/i2psnark/java/src/org/klomp/snark/dht/NodeInfoComparator.java

    rff189e7 r8845ce6  
    44 */
    55
     6import java.io.Serializable;
    67import java.util.Comparator;
    78
     
    1617 * @author zzz
    1718 */
    18 class NodeInfoComparator implements Comparator<NodeInfo> {
     19class NodeInfoComparator implements Comparator<NodeInfo>, Serializable {
    1920    private final byte[] _base;
    2021
  • apps/i2psnark/java/src/org/klomp/snark/web/BasicServlet.java

    rff189e7 r8845ce6  
    8585class BasicServlet extends HttpServlet
    8686{   
    87     protected final I2PAppContext _context;
    88     protected final Log _log;
     87    private static final long serialVersionUID = 1L;
     88    protected transient final I2PAppContext _context;
     89    protected transient final Log _log;
    8990    protected File _resourceBase;
    9091    private String _warBase;
    9192   
    92     private final MimeTypes _mimeTypes;
     93    private transient final MimeTypes _mimeTypes;
    9394   
    9495    /** same as PeerState.PARTSIZE */
    9596    private static final int BUFSIZE = 16*1024;
    96     private ByteCache _cache = ByteCache.getInstance(16, BUFSIZE);
     97    private transient ByteCache _cache = ByteCache.getInstance(16, BUFSIZE);
    9798
    9899    private static final int WAR_CACHE_CONTROL_SECS = 24*60*60;
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    rff189e7 r8845ce6  
    44import java.io.IOException;
    55import java.io.PrintWriter;
     6import java.io.Serializable;
    67import java.text.Collator;
    78import java.text.DecimalFormat;
     
    4546 */
    4647public class I2PSnarkServlet extends BasicServlet {
     48
     49    private static final long serialVersionUID = 1L;
    4750    /** generally "/i2psnark" */
    4851    private String _contextPath;
    4952    /** generally "i2psnark" */
    5053    private String _contextName;
    51     private SnarkManager _manager;
     54    private transient SnarkManager _manager;
    5255    private long _nonce;
    5356    private String _themePath;
     
    11121115     *  @since 0.7.14
    11131116     */
    1114     private static class TorrentNameComparator implements Comparator<Snark> {
    1115         private final Comparator collator = Collator.getInstance();
     1117    private static class TorrentNameComparator implements Comparator<Snark>, Serializable {
    11161118
    11171119        public int compare(Snark l, Snark r) {
     
    11291131            if (rlc.startsWith("the ") || rlc.startsWith("the.") || rlc.startsWith("the_"))
    11301132                rs = rs.substring(4);
    1131             return collator.compare(ls, rs);
     1133            return Collator.getInstance().compare(ls, rs);
    11321134        }
    11331135    }
     
    16281630     *  @since 0.8.1
    16291631     */
    1630     private static class PeerComparator implements Comparator<Peer> {
     1632    private static class PeerComparator implements Comparator<Peer>, Serializable {
     1633
    16311634        public int compare(Peer l, Peer r) {
    16321635            int diff = r.completed() - l.completed();      // reverse
     
    22122215     *  @since 0.9.6
    22132216     */
    2214     private static class ListingComparator implements Comparator<File> {
    2215         private final Comparator collator = Collator.getInstance();
     2217    private static class ListingComparator implements Comparator<File>, Serializable {
    22162218
    22172219        public int compare(File l, File r) {
     
    22202222            if (r.isDirectory() && !l.isDirectory())
    22212223                return 1;
    2222             return collator.compare(l.getName(), r.getName());
     2224            return Collator.getInstance().compare(l.getName(), r.getName());
    22232225        }
    22242226    }
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketAddress.java

    rff189e7 r8845ce6  
    1616public class I2PSocketAddress extends SocketAddress {
    1717
     18    private static final long serialVersionUID = 1L;
    1819    private final int _port;
    19     private Destination _dest;
     20    private transient Destination _dest;
    2021    private final String _host;
    2122
  • apps/routerconsole/java/src/net/i2p/router/update/ConsoleUpdateManager.java

    rff189e7 r8845ce6  
    15861586
    15871587        @Override
     1588        public int hashCode() {
     1589            // findbugs
     1590            return super.hashCode();
     1591        }
     1592
     1593        @Override
    15881594        public String toString() {
    15891595            return "VersionAvailable \"" + version + "\" " + sourceMap +
  • apps/routerconsole/java/src/net/i2p/router/web/BanlistRenderer.java

    rff189e7 r8845ce6  
    1010
    1111import java.io.IOException;
     12import java.io.Serializable;
    1213import java.io.Writer;
    1314import java.util.Comparator;
     
    3132    }
    3233   
    33     private static class HashComparator implements Comparator<Hash> {
     34    private static class HashComparator implements Comparator<Hash>, Serializable {
    3435         public int compare(Hash l, Hash r) {
    3536             return l.toBase64().compareTo(r.toBase64());
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java

    rff189e7 r8845ce6  
    11package net.i2p.router.web;
    22
     3import java.text.Collator;
    34import java.util.ArrayList;
    4 import java.text.Collator;
    55import java.util.Comparator;
    66import java.util.HashSet;
     
    172172    /**
    173173     *  Translated sort
     174     *  Inner class, can't be Serializable
    174175     *  @since 0.9.4
    175176     */
  • apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java

    rff189e7 r8845ce6  
    22
    33import java.io.IOException;
     4import java.io.Serializable;
    45import java.io.Writer;
    56import java.util.Comparator;
     
    441442    }
    442443
    443     private static class AlphaComparator implements Comparator<SummaryListener> {
     444    private static class AlphaComparator implements Comparator<SummaryListener>, Serializable {
    444445        public int compare(SummaryListener l, SummaryListener r) {
    445446            String lName = l.getRate().getRateStat().getName();
  • apps/routerconsole/java/src/net/i2p/router/web/HomeHelper.java

    rff189e7 r8845ce6  
    11package net.i2p.router.web;
    22
     3import java.io.Serializable;
    34import java.util.Collection;
    45import java.util.Comparator;
     
    239240
    240241    /** ignore case, current locale */
    241     private static class AppComparator implements Comparator<App> {
     242    private static class AppComparator implements Comparator<App>, Serializable {
    242243        public int compare(App l, App r) {
    243244            return l.name.toLowerCase().compareTo(r.name.toLowerCase());
  • apps/routerconsole/java/src/net/i2p/router/web/JobQueueHelper.java

    rff189e7 r8845ce6  
    44import java.io.IOException;
    55import java.io.OutputStreamWriter;
     6import java.io.Serializable;
    67import java.io.Writer;
    78import java.util.ArrayList;
     
    205206
    206207    /** @since 0.8.9 */
    207     private static class JobStatsComparator implements Comparator<JobStats> {
     208    private static class JobStatsComparator implements Comparator<JobStats>, Serializable {
    208209         public int compare(JobStats l, JobStats r) {
    209210             return l.getName().compareTo(r.getName());
     
    212213
    213214    /** @since 0.9.5 */
    214     private static class JobCountComparator implements Comparator<String> {
     215    private static class JobCountComparator implements Comparator<String>, Serializable {
    215216         private final ObjectCounter<String> _counter;
    216217
  • apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java

    rff189e7 r8845ce6  
    1010
    1111import java.io.IOException;
     12import java.io.Serializable;
    1213import java.io.Writer;
    1314import java.math.BigInteger;         // debug
     
    4748    }
    4849
     50    /**
     51     *  Inner class, can't be Serializable
     52     */
    4953    private class LeaseSetComparator implements Comparator<LeaseSet> {
    5054         public int compare(LeaseSet l, LeaseSet r) {
     
    6064
    6165    /** for debugging @since 0.7.14 */
    62     private static class LeaseSetRoutingKeyComparator implements Comparator<LeaseSet> {
     66    private static class LeaseSetRoutingKeyComparator implements Comparator<LeaseSet>, Serializable {
    6367         private final Hash _us;
    6468         public LeaseSetRoutingKeyComparator(Hash us) {
     
    7074    }
    7175
    72     private static class RouterInfoComparator implements Comparator<RouterInfo> {
     76    private static class RouterInfoComparator implements Comparator<RouterInfo>, Serializable {
    7377         public int compare(RouterInfo l, RouterInfo r) {
    7478             return l.getIdentity().getHash().toBase64().compareTo(r.getIdentity().getHash().toBase64());
     
    366370    }
    367371
    368     /** sort by translated country name using rules for the current language setting */
     372    /**
     373     *  Sort by translated country name using rules for the current language setting
     374     *  Inner class, can't be Serializable
     375     */
    369376    private class CountryComparator implements Comparator<String> {
    370          Collator coll;
     377         private static final long serialVersionUID = 1L;
     378         private final Collator coll;
    371379
    372380         public CountryComparator() {
  • apps/routerconsole/java/src/net/i2p/router/web/ProfileOrganizerRenderer.java

    rff189e7 r8845ce6  
    22
    33import java.io.IOException;
     4import java.io.Serializable;
    45import java.io.Writer;
    56import java.text.DecimalFormat;
     
    331332     *  @since 0.9.8
    332333     */
    333     private static class HashComparator implements Comparator<PeerProfile> {
     334    private static class HashComparator implements Comparator<PeerProfile>, Serializable {
    334335        public int compare(PeerProfile left, PeerProfile right) {
    335336            return left.getPeer().toBase64().compareTo(right.getPeer().toBase64());
  • apps/routerconsole/java/src/net/i2p/router/web/StatsGenerator.java

    rff189e7 r8845ce6  
    253253    /**
    254254     *  Translated sort
     255     *  Inner class, can't be Serializable
    255256     *  @since 0.9.3
    256257     */
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java

    rff189e7 r8845ce6  
    462462    }
    463463   
    464     /** compare translated nicknames - put "shared clients" first in the sort */
     464    /**
     465     *  Compare translated nicknames - put "shared clients" first in the sort
     466     *  Inner class, can't be Serializable
     467     */
    465468    private class AlphaComparator implements Comparator<Destination> {
    466469        private final String xsc = _("shared clients");
  • apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java

    rff189e7 r8845ce6  
    22
    33import java.io.IOException;
     4import java.io.Serializable;
    45import java.io.Writer;
    56import java.util.ArrayList;
     
    134135    }
    135136   
    136     private static class TunnelComparator implements Comparator<HopConfig> {
     137    private static class TunnelComparator implements Comparator<HopConfig>, Serializable {
    137138         public int compare(HopConfig l, HopConfig r) {
    138139             return (r.getProcessedMessagesCount() - l.getProcessedMessagesCount());
  • apps/susidns/src/java/src/i2p/susi/dns/AddressByNameSorter.java

    rff189e7 r8845ce6  
    2525package i2p.susi.dns;
    2626
     27import java.io.Serializable;
    2728import java.util.Comparator;
    2829
    29 public  class AddressByNameSorter implements Comparator<AddressBean>
     30public class AddressByNameSorter implements Comparator<AddressBean>, Serializable
    3031{
    3132        public int compare(AddressBean a, AddressBean b)
  • apps/susimail/src/src/i2p/susi/webmail/WebMail.java

    rff189e7 r8845ce6  
    4444import java.io.InputStreamReader;
    4545import java.io.PrintWriter;
     46import java.io.Serializable;
    4647import java.io.StringWriter;
    4748import java.io.UnsupportedEncodingException;
     
    236237         * @since 0.9.13
    237238         */
    238         private abstract static class SorterBase implements Comparator<String> {
     239        private abstract static class SorterBase implements Comparator<String>, Serializable {
    239240                private final MailCache mailCache;
    240241               
  • build.xml

    rff189e7 r8845ce6  
    14891489            <arg value="build/i2ptunnel.jar"/>
    14901490            <arg value="build/i2ptunnel.war"/>
     1491            <arg value="build/jetty-i2p.jar"/>
    14911492            <arg value="build/mstreaming.jar"/>
    14921493            <arg value="build/router.jar/"/>
  • core/java/src/gnu/crypto/prng/BasePRNGStandalone.java

    rff189e7 r8845ce6  
    4242// ----------------------------------------------------------------------------
    4343
     44import java.io.Serializable;
    4445import java.util.Map;
    4546
     
    5051 * @version $Revision: 1.1 $
    5152 */
    52 public abstract class BasePRNGStandalone implements IRandomStandalone {
     53public abstract class BasePRNGStandalone implements IRandomStandalone, Serializable {
    5354
    5455   // Constants and variables
  • core/java/src/net/i2p/crypto/CryptixAESKeyCache.java

    rff189e7 r8845ce6  
    11package net.i2p.crypto;
    22
     3import java.io.Serializable;
    34import java.util.concurrent.LinkedBlockingQueue;
    45
     
    5354    public static final KeyCacheEntry createNew() {
    5455        KeyCacheEntry e = new KeyCacheEntry();
    55         e.Ke = new int[ROUNDS + 1][BC]; // encryption round keys
    56         e.Kd = new int[ROUNDS + 1][BC]; // decryption round keys
    57         e.tk = new int[KC];
    58         e.key = new Object[] { e.Ke, e.Kd };
    5956        return e;
    6057    }
     
    6360     * all the data alloc'ed in a makeKey call
    6461     */
    65     public static final class KeyCacheEntry {
    66         int[][] Ke;
    67         int[][] Kd;
    68         int[]   tk;
    69        
    70         Object[] key;
     62    public static class KeyCacheEntry implements Serializable {
     63        /** encryption round keys */
     64        final int[][] Ke;
     65        /** decryption round keys */
     66        final int[][] Kd;
     67        final int[]   tk;
     68        /** Ke, Kd */
     69        final Object[] key;
     70
     71        public KeyCacheEntry() {
     72            Ke = new int[ROUNDS + 1][BC];
     73            Kd = new int[ROUNDS + 1][BC];
     74            tk = new int[KC];
     75            key = new Object[] { Ke, Kd };
     76        }
    7177    }
    7278}
  • core/java/src/net/i2p/crypto/TransientSessionKeyManager.java

    rff189e7 r8845ce6  
    1111
    1212import java.io.IOException;
     13import java.io.Serializable;
    1314import java.io.Writer;
    1415import java.util.ArrayList;
     
    799800     *  Earliest first
    800801     */
    801     private static class TagSetComparator implements Comparator<TagSet> {
     802    private static class TagSetComparator implements Comparator<TagSet>, Serializable {
    802803         public int compare(TagSet l, TagSet r) {
    803804             int rv = (int) (l.getDate() - r.getDate());
  • core/java/src/net/i2p/data/DataHelper.java

    rff189e7 r8845ce6  
    2525import java.io.OutputStreamWriter;
    2626import java.io.PrintWriter;
     27import java.io.Serializable;
    2728import java.io.UnsupportedEncodingException;
    2829import java.math.BigInteger;
     
    14641465     * @since 0.8.3
    14651466     */
    1466     private static class DataStructureComparator implements Comparator<DataStructure> {
     1467    private static class DataStructureComparator implements Comparator<DataStructure>, Serializable {
    14671468        public int compare(DataStructure l, DataStructure r) {
    14681469            return l.calculateHash().toBase64().compareTo(r.calculateHash().toBase64());
  • core/java/src/net/i2p/data/DataStructureImpl.java

    rff189e7 r8845ce6  
    1414import java.io.IOException;
    1515import java.io.InputStream;
     16import java.io.Serializable;
    1617
    1718import net.i2p.I2PAppContext;
     
    2425 * @author jrandom
    2526 */
    26 public abstract class DataStructureImpl implements DataStructure {
     27public abstract class DataStructureImpl implements DataStructure, Serializable {
    2728   
    2829    public String toBase64() {
  • core/java/src/net/i2p/data/Destination.java

    rff189e7 r8845ce6  
    187187        return super.equals(o) && (o instanceof Destination);
    188188    }
     189
     190    @Override
     191    public int hashCode() {
     192        // findbugs
     193        return super.hashCode();
     194    }
    189195}
  • core/java/src/net/i2p/data/i2cp/RequestLeaseSetMessage.java

    rff189e7 r8845ce6  
    1313import java.io.IOException;
    1414import java.io.InputStream;
     15import java.io.Serializable;
    1516import java.util.ArrayList;
    1617import java.util.Date;
     
    2930 */
    3031public class RequestLeaseSetMessage extends I2CPMessageImpl {
     32
     33    private static final long serialVersionUID = 1L;
    3134    public final static int MESSAGE_TYPE = 21;
    3235    private SessionId _sessionId;
    33     private final List<TunnelEndpoint> _endpoints;
     36    // ArrayList is Serializable, List is not
     37    private final ArrayList<TunnelEndpoint> _endpoints;
    3438    private Date _end;
    3539
     
    140144    }
    141145
    142     private static class TunnelEndpoint {
     146    private static class TunnelEndpoint implements Serializable {
     147        private static final long serialVersionUID = 1L;
    143148        private final Hash _router;
    144149        private final TunnelId _tunnelId;
  • core/java/src/net/i2p/data/i2cp/SessionConfig.java

    rff189e7 r8845ce6  
    3636 */
    3737public class SessionConfig extends DataStructureImpl {
    38     private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(SessionConfig.class);
    3938    private Destination _destination;
    4039    private Signature _signature;
     
    126125    public boolean verifySignature() {
    127126        if (getSignature() == null) {
    128             if (_log.shouldLog(Log.WARN)) _log.warn("Signature is null!");
     127            //if (_log.shouldLog(Log.WARN)) _log.warn("Signature is null!");
    129128            return false;
    130129        }
    131130        if (getDestination() == null) {
    132             if (_log.shouldLog(Log.WARN)) _log.warn("Destination is null!");
     131            //if (_log.shouldLog(Log.WARN)) _log.warn("Destination is null!");
    133132            return false;
    134133        }
    135134        if (getCreationDate() == null) {
    136             if (_log.shouldLog(Log.WARN)) _log.warn("Date is null!");
     135            //if (_log.shouldLog(Log.WARN)) _log.warn("Date is null!");
    137136            return false;
    138137        }
    139138        if (tooOld()) {
    140             if (_log.shouldLog(Log.WARN)) _log.warn("Too old!");
     139            //if (_log.shouldLog(Log.WARN)) _log.warn("Too old!");
    141140            return false;
    142141        }
    143142        byte data[] = getBytes();
    144143        if (data == null) {
    145             if (_log.shouldLog(Log.WARN)) _log.warn("Bytes could not be found - wtf?");
     144            //if (_log.shouldLog(Log.WARN)) _log.warn("Bytes could not be found - wtf?");
    146145            return false;
    147146        }
     
    150149                                                             getDestination().getSigningPublicKey());
    151150        if (!ok) {
    152             if (_log.shouldLog(Log.WARN)) _log.warn("DSA signature failed!");
     151            Log log = I2PAppContext.getGlobalContext().logManager().getLog(SessionConfig.class);
     152            if (log.shouldLog(Log.WARN)) log.warn("DSA signature failed!");
    153153        }
    154154        return ok;
     
    178178            DataHelper.writeDate(out, _creationDate);
    179179        } catch (IOException ioe) {
    180             _log.error("IOError signing", ioe);
     180            Log log = I2PAppContext.getGlobalContext().logManager().getLog(SessionConfig.class);
     181            log.error("IOError signing", ioe);
    181182            return null;
    182183        } catch (DataFormatException dfe) {
    183             _log.error("Error writing out the bytes for signing/verification", dfe);
     184            Log log = I2PAppContext.getGlobalContext().logManager().getLog(SessionConfig.class);
     185            log.error("Error writing out the bytes for signing/verification", dfe);
    184186            return null;
    185187        }
  • core/java/src/net/i2p/kademlia/KBucketSet.java

    rff189e7 r8845ce6  
    99 */
    1010
     11import java.io.Serializable;
    1112import java.math.BigInteger;
    1213import java.util.ArrayList;
     
    751752     *  Returns equal for any overlap.
    752753     */
    753     private static class BucketComparator<T extends SimpleDataStructure> implements Comparator<KBucket<T>> {
     754    private static class BucketComparator<T extends SimpleDataStructure> implements Comparator<KBucket<T>>, Serializable {
    754755        public int compare(KBucket<T> l, KBucket<T> r) {
    755756            if (l.getRangeEnd() < r.getRangeBegin())
  • core/java/src/net/i2p/kademlia/XORComparator.java

    rff189e7 r8845ce6  
    11package net.i2p.kademlia;
    22
     3import java.io.Serializable;
    34import java.util.Comparator;
    45
     
    1011 * @since 0.9.2 in i2psnark, moved to core in 0.9.10
    1112 */
    12 public class XORComparator<T extends SimpleDataStructure> implements Comparator<T> {
     13public class XORComparator<T extends SimpleDataStructure> implements Comparator<T>, Serializable {
    1314    private final byte[] _base;
    1415
  • core/java/src/net/i2p/util/CachedIteratorArrayList.java

    rff189e7 r8845ce6  
    11package net.i2p.util;
    22
     3import java.io.Serializable;
    34import java.util.ArrayList;
    45import java.util.Collection;
     
    3940    }
    4041
    41     private class CachedIterator implements Iterator<E> {
     42    private class CachedIterator implements Iterator<E>, Serializable {
    4243        /**
    4344         * Index of element to be returned by subsequent call to next.
  • core/java/src/net/i2p/util/NativeBigInteger.java

    rff189e7 r8845ce6  
    812812        return super.equals(o);
    813813    }
     814
     815    @Override
     816    public int hashCode() {
     817        // for findbugs
     818        return super.hashCode();
     819    }
    814820}
  • core/java/src/net/i2p/util/OrderedProperties.java

    rff189e7 r8845ce6  
    1010 */
    1111
     12import java.io.Serializable;
    1213import java.util.Collections;
    1314import java.util.Comparator;
     
    4748    }
    4849
    49     private static class EntryComparator implements Comparator<Map.Entry<Object, Object>> {
     50    private static class EntryComparator implements Comparator<Map.Entry<Object, Object>>, Serializable {
    5051         public int compare(Map.Entry<Object, Object> l, Map.Entry<Object, Object> r) {
    5152             return ((String)l.getKey()).compareTo(((String)r.getKey()));
  • core/java/src/net/i2p/util/RandomSource.java

    rff189e7 r8845ce6  
    2626 */
    2727public class RandomSource extends SecureRandom implements EntropyHarvester {
     28
     29    private static final long serialVersionUID = 1L;
    2830    private final EntropyHarvester _entropyHarvester;
    29     protected final I2PAppContext _context;
     31    protected transient final I2PAppContext _context;
    3032
    3133    /**
  • core/java/src/net/i2p/util/VersionComparator.java

    rff189e7 r8845ce6  
    11package net.i2p.util;
    22
     3import java.io.Serializable;
    34import java.util.Comparator;
    45
     
    1011 * @since 0.7.10
    1112 */
    12 public class VersionComparator implements Comparator<String> {
     13public class VersionComparator implements Comparator<String>, Serializable {
    1314
    1415    public int compare(String l, String r) {
  • core/java/src/net/metanotion/io/block/index/BSkipLevels.java

    rff189e7 r8845ce6  
    3030
    3131import java.io.IOException;
     32import java.io.Serializable;
    3233import java.util.Comparator;
    3334import java.util.Set;
     
    312313         *  @since 0.8.8
    313314         */
    314         private static class LevelComparator implements Comparator<SkipLevels> {
     315        private static class LevelComparator implements Comparator<SkipLevels>, Serializable {
    315316                public int compare(SkipLevels l, SkipLevels r) {
    316317                        Comparable lk = l.key();
  • router/java/src/net/i2p/data/i2np/GarlicClove.java

    rff189e7 r8845ce6  
    3030 */
    3131public class GarlicClove extends DataStructureImpl {
     32
    3233    //private final Log _log;
    33     private final I2PAppContext _context;
     34    private static final long serialVersionUID = 1L;
     35    private transient final I2PAppContext _context;
    3436    private DeliveryInstructions _instructions;
    3537    private I2NPMessage _msg;
  • router/java/src/net/i2p/router/JobQueue.java

    rff189e7 r8845ce6  
    1010
    1111import java.io.IOException;
     12import java.io.Serializable;
    1213import java.io.Writer;
    1314import java.util.Collection;
     
    659660     *  @since 0.8.9
    660661     */
    661     private static class JobComparator implements Comparator<Job> {
     662    private static class JobComparator implements Comparator<Job>, Serializable {
    662663         public int compare(Job l, Job r) {
    663664             // equals first, Jobs generally don't override so this should be fast
  • router/java/src/net/i2p/router/PersistentKeyRing.java

    rff189e7 r8845ce6  
    1717 */
    1818public class PersistentKeyRing extends KeyRing {
    19     private RouterContext _ctx;
     19
     20    private static final long serialVersionUID = 1L;
     21    private transient final RouterContext _ctx;
    2022    private static final String PROP_PFX = "router.keyring.key.";
    2123
  • router/java/src/net/i2p/router/peermanager/InverseCapacityComparator.java

    rff189e7 r8845ce6  
    11package net.i2p.router.peermanager;
    22
     3import java.io.Serializable;
    34import java.util.Comparator;
    45
     
    910 *
    1011 */
    11 class InverseCapacityComparator implements Comparator<PeerProfile> {
     12class InverseCapacityComparator implements Comparator<PeerProfile>, Serializable {
    1213    /**
    1314     * Compare the two objects backwards.  The standard comparator returns
  • router/java/src/net/i2p/router/peermanager/SpeedComparator.java

    rff189e7 r8845ce6  
    11package net.i2p.router.peermanager;
    22
     3import java.io.Serializable;
    34import java.util.Comparator;
    45
     
    910 * @since 0.7.10
    1011 */
    11 class SpeedComparator implements Comparator<PeerProfile> {
     12class SpeedComparator implements Comparator<PeerProfile>, Serializable {
    1213
    1314    public int compare(PeerProfile left, PeerProfile right) {
  • router/java/src/net/i2p/router/transport/TransportImpl.java

    rff189e7 r8845ce6  
    1010
    1111import java.io.IOException;
     12import java.io.Serializable;
    1213import java.io.Writer;
    1314import java.net.InetAddress;
     
    628629     *  @since IPv6
    629630     */
    630     private static class AddrComparator implements Comparator<RouterAddress> {
     631    private static class AddrComparator implements Comparator<RouterAddress>, Serializable {
    631632        private final int adj;
    632633
  • router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java

    rff189e7 r8845ce6  
    22
    33import java.io.IOException;
     4import java.io.Serializable;
    45import java.net.InetSocketAddress;
    56import java.net.InetAddress;
     
    12761277    }
    12771278
    1278     private static class PeerComparator implements Comparator<NTCPConnection> {
     1279    private static class PeerComparator implements Comparator<NTCPConnection>, Serializable {
    12791280        public int compare(NTCPConnection l, NTCPConnection r) {
    12801281            if (l == null || r == null)
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    rff189e7 r8845ce6  
    22
    33import java.io.IOException;
     4import java.io.Serializable;
    45import java.io.Writer;
    56import java.net.InetAddress;
     
    22412242   
    22422243    private static Comparator<PeerState> getComparator(int sortFlags) {
    2243         Comparator<PeerState> rv = null;
     2244        Comparator<PeerState> rv;
    22442245        switch (Math.abs(sortFlags)) {
    22452246            case FLAG_IDLE_IN:
    2246                 rv = IdleInComparator.instance();
     2247                rv = new IdleInComparator();
    22472248                break;
    22482249            case FLAG_IDLE_OUT:
    2249                 rv = IdleOutComparator.instance();
     2250                rv = new IdleOutComparator();
    22502251                break;
    22512252            case FLAG_RATE_IN:
    2252                 rv = RateInComparator.instance();
     2253                rv = new RateInComparator();
    22532254                break;
    22542255            case FLAG_RATE_OUT:
    2255                 rv = RateOutComparator.instance();
     2256                rv = new RateOutComparator();
    22562257                break;
    22572258            case FLAG_UPTIME:
    2258                 rv = UptimeComparator.instance();
     2259                rv = new UptimeComparator();
    22592260                break;
    22602261            case FLAG_SKEW:
    2261                 rv = SkewComparator.instance();
     2262                rv = new SkewComparator();
    22622263                break;
    22632264            case FLAG_CWND:
    2264                 rv = CwndComparator.instance();
     2265                rv = new CwndComparator();
    22652266                break;
    22662267            case FLAG_SSTHRESH:
    2267                 rv = SsthreshComparator.instance();
     2268                rv = new SsthreshComparator();
    22682269                break;
    22692270            case FLAG_RTT:
    2270                 rv = RTTComparator.instance();
     2271                rv = new RTTComparator();
    22712272                break;
    22722273            //case FLAG_DEV:
    2273             //    rv = DevComparator.instance();
     2274            //    rv = new DevComparator();
    22742275            //    break;
    22752276            case FLAG_RTO:
    2276                 rv = RTOComparator.instance();
     2277                rv = new RTOComparator();
    22772278                break;
    22782279            case FLAG_MTU:
    2279                 rv = MTUComparator.instance();
     2280                rv = new MTUComparator();
    22802281                break;
    22812282            case FLAG_SEND:
    2282                 rv = SendCountComparator.instance();
     2283                rv = new SendCountComparator();
    22832284                break;
    22842285            case FLAG_RECV:
    2285                 rv = RecvCountComparator.instance();
     2286                rv = new RecvCountComparator();
    22862287                break;
    22872288            case FLAG_RESEND:
    2288                 rv = ResendComparator.instance();
     2289                rv = new ResendComparator();
    22892290                break;
    22902291            case FLAG_DUP:
    2291                 rv = DupComparator.instance();
     2292                rv = new DupComparator();
    22922293                break;
    22932294            case FLAG_ALPHA:
    22942295            default:
    2295                 rv = AlphaComparator.instance();
     2296                rv = new AlphaComparator();
    22962297                break;
    22972298        }
     
    23022303
    23032304    private static class AlphaComparator extends PeerComparator {
    2304         private static final AlphaComparator _instance = new AlphaComparator();
    2305         public static final AlphaComparator instance() { return _instance; }
    2306     }
     2305    }
     2306
    23072307    private static class IdleInComparator extends PeerComparator {
    2308         private static final IdleInComparator _instance = new IdleInComparator();
    2309         public static final IdleInComparator instance() { return _instance; }
    23102308        @Override
    23112309        public int compare(PeerState l, PeerState r) {
     
    23172315        }
    23182316    }
     2317
    23192318    private static class IdleOutComparator extends PeerComparator {
    2320         private static final IdleOutComparator _instance = new IdleOutComparator();
    2321         public static final IdleOutComparator instance() { return _instance; }
    23222319        @Override
    23232320        public int compare(PeerState l, PeerState r) {
     
    23292326        }
    23302327    }
     2328
    23312329    private static class RateInComparator extends PeerComparator {
    2332         private static final RateInComparator _instance = new RateInComparator();
    2333         public static final RateInComparator instance() { return _instance; }
    23342330        @Override
    23352331        public int compare(PeerState l, PeerState r) {
     
    23412337        }
    23422338    }
     2339
    23432340    private static class RateOutComparator extends PeerComparator {
    2344         private static final RateOutComparator _instance = new RateOutComparator();
    2345         public static final RateOutComparator instance() { return _instance; }
    23462341        @Override
    23472342        public int compare(PeerState l, PeerState r) {
     
    23532348        }
    23542349    }
     2350
    23552351    private static class UptimeComparator extends PeerComparator {
    2356         private static final UptimeComparator _instance = new UptimeComparator();
    2357         public static final UptimeComparator instance() { return _instance; }
    23582352        @Override
    23592353        public int compare(PeerState l, PeerState r) {
     
    23652359        }
    23662360    }
     2361
    23672362    private static class SkewComparator extends PeerComparator {
    2368         private static final SkewComparator _instance = new SkewComparator();
    2369         public static final SkewComparator instance() { return _instance; }
    23702363        @Override
    23712364        public int compare(PeerState l, PeerState r) {
     
    23772370        }
    23782371    }
     2372
    23792373    private static class CwndComparator extends PeerComparator {
    2380         private static final CwndComparator _instance = new CwndComparator();
    2381         public static final CwndComparator instance() { return _instance; }
    23822374        @Override
    23832375        public int compare(PeerState l, PeerState r) {
     
    23892381        }
    23902382    }
     2383
    23912384    private static class SsthreshComparator extends PeerComparator {
    2392         private static final SsthreshComparator _instance = new SsthreshComparator();
    2393         public static final SsthreshComparator instance() { return _instance; }
    23942385        @Override
    23952386        public int compare(PeerState l, PeerState r) {
     
    24012392        }
    24022393    }
     2394
    24032395    private static class RTTComparator extends PeerComparator {
    2404         private static final RTTComparator _instance = new RTTComparator();
    2405         public static final RTTComparator instance() { return _instance; }
    24062396        @Override
    24072397        public int compare(PeerState l, PeerState r) {
     
    24312421    /** */
    24322422    private static class RTOComparator extends PeerComparator {
    2433         private static final RTOComparator _instance = new RTOComparator();
    2434         public static final RTOComparator instance() { return _instance; }
    24352423        @Override
    24362424        public int compare(PeerState l, PeerState r) {
     
    24422430        }
    24432431    }
     2432
    24442433    private static class MTUComparator extends PeerComparator {
    2445         private static final MTUComparator _instance = new MTUComparator();
    2446         public static final MTUComparator instance() { return _instance; }
    24472434        @Override
    24482435        public int compare(PeerState l, PeerState r) {
     
    24542441        }
    24552442    }
     2443
    24562444    private static class SendCountComparator extends PeerComparator {
    2457         private static final SendCountComparator _instance = new SendCountComparator();
    2458         public static final SendCountComparator instance() { return _instance; }
    24592445        @Override
    24602446        public int compare(PeerState l, PeerState r) {
     
    24662452        }
    24672453    }
     2454
    24682455    private static class RecvCountComparator extends PeerComparator {
    2469         private static final RecvCountComparator _instance = new RecvCountComparator();
    2470         public static final RecvCountComparator instance() { return _instance; }
    24712456        @Override
    24722457        public int compare(PeerState l, PeerState r) {
     
    24782463        }
    24792464    }
     2465
    24802466    private static class ResendComparator extends PeerComparator {
    2481         private static final ResendComparator _instance = new ResendComparator();
    2482         public static final ResendComparator instance() { return _instance; }
    24832467        @Override
    24842468        public int compare(PeerState l, PeerState r) {
     
    24902474        }
    24912475    }
     2476
    24922477    private static class DupComparator extends PeerComparator {
    2493         private static final DupComparator _instance = new DupComparator();
    2494         public static final DupComparator instance() { return _instance; }
    24952478        @Override
    24962479        public int compare(PeerState l, PeerState r) {
     
    25032486    }
    25042487   
    2505     private static class PeerComparator implements Comparator<PeerState> {
     2488    private static class PeerComparator implements Comparator<PeerState>, Serializable {
    25062489        public int compare(PeerState l, PeerState r) {
    25072490            return DataHelper.compareTo(l.getRemotePeer().getData(), r.getRemotePeer().getData());
  • router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java

    rff189e7 r8845ce6  
    11package net.i2p.router.tunnel.pool;
    22
     3import java.io.Serializable;
    34import java.util.ArrayList;
    45import java.util.Collections;
     
    437438     *  during the sort. This will cause Java 7 sort to throw an IAE.
    438439     */
    439     private static class TunnelPoolComparator implements Comparator<TunnelPool> {
     440    private static class TunnelPoolComparator implements Comparator<TunnelPool>, Serializable {
    440441
    441442        private final boolean _preferEmpty;
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPeerSelector.java

    rff189e7 r8845ce6  
    11package net.i2p.router.tunnel.pool;
    22
     3import java.io.Serializable;
    34import java.math.BigInteger;
    45import java.util.ArrayList;
     
    526527     *     d((H(l+h), h) - d(H(r+h), h)
    527528     */
    528     private static class HashComparator implements Comparator<Hash> {
     529    private static class HashComparator implements Comparator<Hash>, Serializable {
    529530        private final Hash _hash, tmp;
    530531        private final byte[] data;
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java

    rff189e7 r8845ce6  
    11package net.i2p.router.tunnel.pool;
    22
     3import java.io.Serializable;
    34import java.util.ArrayList;
    45import java.util.Collections;
     
    641642     *
    642643     */
    643     private static class LeaseComparator implements Comparator<Lease> {
     644    private static class LeaseComparator implements Comparator<Lease>, Serializable {
    644645         public int compare(Lease l, Lease r) {
    645646             return r.getEndDate().compareTo(l.getEndDate());
     
    652653     * @since 0.8.10
    653654     */
    654     private static class TunnelInfoComparator implements Comparator<TunnelInfo> {
     655    private static class TunnelInfoComparator implements Comparator<TunnelInfo>, Serializable {
    655656        private final byte[] _base;
    656657        private final boolean _avoidZero;
  • router/java/src/net/i2p/router/util/CoDelBlockingQueue.java

    rff189e7 r8845ce6  
    2727public class CoDelBlockingQueue<E extends CDQEntry> extends LinkedBlockingQueue<E> {
    2828
    29     private final I2PAppContext _context;
    30     private final Log _log;
     29    private static final long serialVersionUID = 1L;
     30    private transient final I2PAppContext _context;
     31    private transient final Log _log;
    3132    private final String _name;
    3233    private final int _capacity;
  • router/java/src/net/i2p/router/util/PriBlockingQueue.java

    rff189e7 r8845ce6  
    11package net.i2p.router.util;
    22
     3import java.io.Serializable;
    34import java.util.Comparator;
    45import java.util.concurrent.PriorityBlockingQueue;
     
    2021public class PriBlockingQueue<E extends PQEntry> extends PriorityBlockingQueue<E> {
    2122
    22     protected final I2PAppContext _context;
    23     protected final Log _log;
     23    private static final long serialVersionUID = 1L;
     24    protected transient final I2PAppContext _context;
     25    protected transient final Log _log;
    2426    protected final String _name;
    2527    private final AtomicLong _seqNum = new AtomicLong();
     
    115117     *  highest priority first, then lowest sequence number first
    116118     */
    117     private static class PriorityComparator<E extends PQEntry> implements Comparator<E> {
     119    private static class PriorityComparator<E extends PQEntry> implements Comparator<E>, Serializable {
    118120        public int compare(E l, E r) {
    119121            int d = r.getPriority() - l.getPriority();
Note: See TracChangeset for help on using the changeset viewer.