Changeset 3fbff718


Ignore:
Timestamp:
Aug 11, 2009 9:58:56 PM (11 years ago)
Author:
sponge <sponge@…>
Branches:
master
Children:
35da3f3, 55e8583, b033db96, d998e2e
Parents:
e5eea47
Message:

2009-08-11 sponge

  • Code Janitor time! Many fixes and documenting fixes that should be done in the future. for the most part, this is a general code cleanup.
  • On smaller/embedded systems, the "final" keyword cleanups will have more of an impact than on larger systems.
  • Document missing hashCode() methods.
  • Unhide more variables to make code easier to read.
Files:
166 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/BWLimits.java

    re5eea47 r3fbff718  
    88import java.util.Properties;
    99
    10 import net.i2p.I2PAppContext;
    1110import net.i2p.client.I2PSessionException;
    1211import net.i2p.client.I2PClient;
  • apps/i2psnark/java/src/org/klomp/snark/BitField.java

    re5eea47 r3fbff718  
    138138  }
    139139
     140    @Override
    140141  public String toString()
    141142  {
  • apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java

    re5eea47 r3fbff718  
    4747    private I2PSocketManager _manager;
    4848    private boolean _configured;
    49     private Set _shitlist;
     49    private final Set _shitlist;
    5050    private int _maxUploaders;
    5151    private int _maxUpBW;
  • apps/i2psnark/java/src/org/klomp/snark/Message.java

    re5eea47 r3fbff718  
    111111  }
    112112
     113    @Override
    113114  public String toString()
    114115  {
  • apps/i2psnark/java/src/org/klomp/snark/MetaInfo.java

    re5eea47 r3fbff718  
    346346  }
    347347
     348    @Override
    348349  public String toString()
    349350  {
  • apps/i2psnark/java/src/org/klomp/snark/Peer.java

    re5eea47 r3fbff718  
    107107   * Returns the String representation of the peerID.
    108108   */
     109    @Override
    109110  public String toString()
    110111  {
     
    126127   * The hash code of a Peer is the hash code of the peerID.
    127128   */
     129    @Override
    128130  public int hashCode()
    129131  {
     
    135137   * All other properties are ignored.
    136138   */
     139    @Override
    137140  public boolean equals(Object o)
    138141  {
  • apps/i2psnark/java/src/org/klomp/snark/PeerConnectionOut.java

    re5eea47 r3fbff718  
    4242
    4343  // Contains Messages.
    44   private List sendQueue = new ArrayList();
     44  private final List sendQueue = new ArrayList();
    4545 
    4646  private static long __id = 0;
  • apps/i2psnark/java/src/org/klomp/snark/PeerCoordinatorSet.java

    re5eea47 r3fbff718  
    1313 */
    1414public class PeerCoordinatorSet {
    15     private Set _coordinators;
     15    private final Set _coordinators;
    1616   
    1717    public PeerCoordinatorSet() {
  • apps/i2psnark/java/src/org/klomp/snark/PeerID.java

    re5eea47 r3fbff718  
    108108   * The hash code of a PeerID is the exclusive or of all id bytes.
    109109   */
     110    @Override
    110111  public int hashCode()
    111112  {
     
    128129   * Two PeerIDs are equal when they have the same id, address and port.
    129130   */
     131    @Override
    130132  public boolean equals(Object o)
    131133  {
     
    172174   * should match what the bytemonsoon tracker reports on its web pages.
    173175   */
     176    @Override
    174177  public String toString()
    175178  {
  • apps/i2psnark/java/src/org/klomp/snark/PeerListener.java

    re5eea47 r3fbff718  
    152152   * @param state the PeerState for the peer
    153153   */
    154   void savePeerPartial(PeerState state);
     154  void savePeerPartial(PeerState state); /* FIXME Exporting non-public type through public API FIXME */
    155155
    156156  /**
     
    162162   * @return request (contains the partial data and valid length)
    163163   */
    164   Request getPeerPartial(BitField havePieces);
     164  Request getPeerPartial(BitField havePieces); /* FIXME Exporting non-public type through public API FIXME */
    165165
    166166  /** Mark a peer's requested pieces unrequested when it is disconnected
  • apps/i2psnark/java/src/org/klomp/snark/Piece.java

    re5eea47 r3fbff718  
    2121    }
    2222   
     23    @Override
    2324    public boolean equals(Object o) {
    24         if (o == null) return false;
    25         try {
    26             return this.id == ((Piece)o).id;
    27         } catch (ClassCastException cce) {
    28             return false;
     25        if (o instanceof Piece) {
     26            if (o == null) return false;
     27            try {
     28                return this.id == ((Piece)o).id;
     29            } catch (ClassCastException cce) {
     30                return false;
     31            }
    2932        }
     33        return false;
     34    }
     35
     36    @Override
     37    public int hashCode() {
     38        int hash = 5;
     39        hash = 31 * hash + this.id;
     40        return hash;
    3041    }
    3142   
     
    3748    public void setRequested(boolean requested) { this.requested = requested; }
    3849   
     50    @Override
    3951    public String toString() {
    4052        return String.valueOf(id);
  • apps/i2psnark/java/src/org/klomp/snark/Request.java

    re5eea47 r3fbff718  
    5252  }
    5353
     54    @Override
    5455  public int hashCode()
    5556  {
     
    5758  }
    5859
     60    @Override
    5961  public boolean equals(Object o)
    6062  {
     
    6870  }
    6971
     72    @Override
    7073  public String toString()
    7174  {
  • apps/i2psnark/java/src/org/klomp/snark/Snark.java

    re5eea47 r3fbff718  
    2929import java.util.Iterator;
    3030import java.util.List;
    31 import java.util.Map;
    3231import java.util.Properties;
    3332import java.util.Random;
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    re5eea47 r3fbff718  
    3030   
    3131    /** map of (canonical) filename to Snark instance (unsynchronized) */
    32     private Map _snarks;
    33     private Object _addSnarkLock;
    34     private File _configFile;
     32    private final Map _snarks;
     33    private final Object _addSnarkLock;
     34    private /* FIXME final FIXME */ File _configFile;
    3535    private Properties _config;
    3636    private I2PAppContext _context;
    3737    private Log _log;
    38     private List _messages;
     38    private final List _messages;
    3939    private I2PSnarkUtil _util;
    4040    private PeerCoordinatorSet _peerCoordinatorSet;
     
    748748
    749749    public class SnarkManagerShutdown extends I2PAppThread {
     750        @Override
    750751        public void run() {
    751752            Set names = listTorrentFiles();
  • apps/i2psnark/java/src/org/klomp/snark/SnarkShutdown.java

    re5eea47 r3fbff718  
    3737  private final ShutdownListener listener;
    3838
     39  /* FIXME Exporting non-public type through public API FIXME */
    3940  public SnarkShutdown(Storage storage,
    4041                       PeerCoordinator coordinator,
     
    5051  }
    5152
     53    @Override
    5254  public void run()
    5355  {
  • apps/i2psnark/java/src/org/klomp/snark/Storage.java

    re5eea47 r3fbff718  
    4747  private I2PSnarkUtil _util;
    4848
    49   private BitField bitfield; // BitField to represent the pieces
     49  private /* FIXME final FIXME */ BitField bitfield; // BitField to represent the pieces
    5050  private int needed; // Number of pieces needed
    5151  private boolean _probablyComplete;  // use this to decide whether to open files RO
  • apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java

    re5eea47 r3fbff718  
    8282  }
    8383
     84    @Override
    8485  public void start() {
    8586      if (stop) throw new RuntimeException("Dont rerun me, create a copy");
     
    110111  }
    111112 
     113    @Override
    112114  public void run()
    113115  {
     
    163165      {
    164166        if (!verifyConnected()) return;
    165         boolean started = false;
     167        boolean runStarted = false;
    166168        boolean firstTime = true;
    167169        int consecutiveFails = 0;
     
    179181                  delay = r.nextInt(30*1000);
    180182                  firstTime = false;
    181                 } else if (completed && started)
     183                } else if (completed && runStarted)
    182184                  delay = 3*SLEEP*60*1000 + random;
    183185                else if (coordinator.trackerProblems != null && ++consecutiveFails < MAX_CONSEC_FAILS)
     
    222224              if ((!stop) && (!tr.stop) &&
    223225                  (completed || coordinator.needPeers()) &&
    224                   (event == COMPLETED_EVENT || System.currentTimeMillis() > tr.lastRequestTime + tr.interval))
     226                  (event.equals(COMPLETED_EVENT) || System.currentTimeMillis() > tr.lastRequestTime + tr.interval))
    225227              {
    226228                try
     
    238240                    if (tr.isPrimary)
    239241                        consecutiveFails = 0;
    240                     started = true;
     242                    runStarted = true;
    241243                    tr.started = true;
    242244
     
    297299            // we could try and total the unique peers but that's too hard for now
    298300            coordinator.trackerSeenPeers = maxSeenPeers;
    299             if (!started)
     301            if (!runStarted)
    300302                _util.debug("         Retrying in one minute...", Snark.DEBUG);
    301303          } // *** end of while loop
     
    339341      + "&downloaded=" + downloaded
    340342      + "&left=" + left
    341       + ((event != NO_EVENT) ? ("&event=" + event) : "");
     343      + ((! event.equals(NO_EVENT)) ? ("&event=" + event) : "");
    342344    _util.debug("Sending TrackerClient request: " + s, Snark.INFO);
    343345     
  • apps/i2psnark/java/src/org/klomp/snark/TrackerInfo.java

    re5eea47 r3fbff718  
    126126  }
    127127
     128    @Override
    128129  public String toString()
    129130  {
  • apps/i2psnark/java/src/org/klomp/snark/bencode/BEValue.java

    re5eea47 r3fbff718  
    173173  public Object getValue() { return value; }
    174174 
     175    @Override
    175176  public String toString()
    176177  {
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    re5eea47 r3fbff718  
    2828import net.i2p.util.Log;
    2929
    30 import org.klomp.snark.I2PSnarkUtil;
    3130import org.klomp.snark.MetaInfo;
    3231import org.klomp.snark.Peer;
     
    4746    public static final String PROP_CONFIG_FILE = "i2psnark.configFile";
    4847   
     48    @Override
    4949    public void init(ServletConfig cfg) throws ServletException {
    5050        super.init(cfg);
     
    6060    }
    6161   
     62    @Override
    6263    public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    6364        req.setCharacterEncoding("UTF-8");
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/BufferLogger.java

    re5eea47 r3fbff718  
    1515class BufferLogger implements Logging {
    1616    private final static Log _log = new Log(BufferLogger.class);
    17     private ByteArrayOutputStream _baos; // should be final and use a factory. LINT
     17    private ByteArrayOutputStream _baos; // FIXME should be final and use a factory. FIXME
    1818    private boolean _ignore;
    1919
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java

    re5eea47 r3fbff718  
    6767   
    6868    /** List of Socket for those accept()ed but not yet started up */
    69     private List _waitingSockets = new ArrayList(); // should be final and use a factory. LINT
     69    private List _waitingSockets = new ArrayList(); // FIXME should be final and use a factory. FIXME
    7070    /** How many connections will we allow to be in the process of being built at once? */
    7171    private int _numConnectionBuilders;
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java

    re5eea47 r3fbff718  
    154154     *
    155155     */
     156    @Override
    156157    protected I2PSocketOptions getDefaultOptions() {
    157158        Properties defaultOpts = getTunnel().getClientOptions();
     
    260261            }
    261262           
    262             Destination dest = I2PTunnel.destFromName(destination);
    263             if (dest == null) {
     263            Destination clientDest = I2PTunnel.destFromName(destination);
     264            if (clientDest == null) {
    264265                String str;
    265266                byte[] header;
     
    277278            }
    278279
    279             I2PSocket i2ps = createI2PSocket(dest, getDefaultOptions());
     280            I2PSocket i2ps = createI2PSocket(clientDest, getDefaultOptions());
    280281            byte[] data = null;
    281282            byte[] response = null;
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java

    re5eea47 r3fbff718  
    192192     * unused?
    193193     */
     194    @Override
    194195    protected I2PSocketOptions getDefaultOptions() {
    195196        Properties defaultOpts = getTunnel().getClientOptions();
     
    208209     *
    209210     */
     211    @Override
    210212    protected I2PSocketOptions getDefaultOptions(Properties overrides) {
    211213        Properties defaultOpts = getTunnel().getClientOptions();
     
    562564            }
    563565
    564             Destination dest = I2PTunnel.destFromName(destination);
    565             if (dest == null) {
     566            Destination clientDest = I2PTunnel.destFromName(destination);
     567            if (clientDest == null) {
    566568                //l.log("Could not resolve " + destination + ".");
    567569                if (_log.shouldLog(Log.WARN))
     
    595597            // dont want to hard link to here
    596598            //opts.setProperty("i2p.streaming.inactivityTimeoutAction", ""+1);
    597             I2PSocket i2ps = createI2PSocket(dest, getDefaultOptions(opts));
     599            I2PSocket i2ps = createI2PSocket(clientDest, getDefaultOptions(opts));
    598600            byte[] data = newRequest.toString().getBytes("ISO-8859-1");
    599601            Runnable onTimeout = new OnTimeout(s, s.getOutputStream(), targetRequest, usingWWWProxy, currentProxy, requestId);
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java

    re5eea47 r3fbff718  
    7878        if (_log.shouldLog(Log.DEBUG))
    7979            _log.debug("got a connection.");
    80         Destination dest = pickDestination();
     80        Destination clientDest = pickDestination();
    8181        I2PSocket i2ps = null;
    8282        try {
    83             i2ps = createI2PSocket(dest);
     83            i2ps = createI2PSocket(clientDest);
    8484            i2ps.setReadTimeout(readTimeout);
    8585            StringBuilder expectedPong = new StringBuilder();
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Pinger.java

    re5eea47 r3fbff718  
    5555    protected Sink sink;
    5656    protected Thread thread;
    57     protected Object waitlock; // should be final and use a factory. LINT
     57    protected Object waitlock; // FIXME should be final and use a factory. FIXME
    5858    protected boolean running;
    5959}
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/udp/I2PSink.java

    re5eea47 r3fbff718  
    7070    protected I2PSession sess;
    7171    protected Destination dest;
    72     protected I2PDatagramMaker maker; // should be final and use a factory. LINT
     72    protected I2PDatagramMaker maker; // FIXME should be final and use a factory. FIXME
    7373}
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/udp/I2PSinkAnywhere.java

    re5eea47 r3fbff718  
    6868    protected I2PSession sess;
    6969    protected Destination dest;
    70     protected I2PDatagramMaker maker; // should be final and use a factory. LINT
     70    protected I2PDatagramMaker maker; // FIXME should be final and use a factory. FIXME
    7171}
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/udpTunnel/I2PTunnelUDPClientBase.java

    re5eea47 r3fbff718  
    6161    private ServerSocket ss;
    6262
    63     private Object startLock = new Object();
     63    private final Object startLock = new Object();
    6464    private boolean startRunning = false;
    6565
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketImpl.java

    re5eea47 r3fbff718  
    3030    private String localID;
    3131    private String remoteID;
    32     private Object remoteIDWaiter = new Object();
     32    private final Object remoteIDWaiter = new Object();
    3333    private I2PInputStream in;
    3434    private I2POutputStream out;
     
    4343    private long _remoteIdSetTime;
    4444    private I2PSocketOptions _options;
    45     private Object flagLock = new Object();
     45    private final Object flagLock = new Object();
    4646
    4747    /**
     
    307307    private class I2PInputStream extends InputStream {
    308308        private String streamName;
    309         private ByteCollector bc = new ByteCollector();
     309        private final ByteCollector bc = new ByteCollector();
    310310        private boolean inStreamClosed = false;
    311311
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java

    re5eea47 r3fbff718  
    1414import net.i2p.client.I2PSession;
    1515import net.i2p.client.I2PSessionException;
    16 import net.i2p.data.Destination;
    1716import net.i2p.util.Log;
    1817
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerImpl.java

    re5eea47 r3fbff718  
    4141    private I2PAppContext _context;
    4242    private Log _log;
    43     private /* final */ I2PSession _session;
     43    private /* FIXME final FIXME */ I2PSession _session;
    4444    private I2PServerSocketImpl _serverSocket = null;
    4545    private final Object lock = new Object(); // for locking socket lists
  • apps/streaming/java/src/net/i2p/client/streaming/ConnectionOptions.java

    re5eea47 r3fbff718  
    6363
    6464    // Syncronization fix, but doing it this way causes NPE...
    65     // private final int _trend[] = new int[TREND_COUNT];
     65    // FIXME private final int _trend[] = new int[TREND_COUNT]; FIXME
    6666    private int _trend[];
    6767
  • core/java/src/com/nettgryppa/security/HashCash.java

    re5eea47 r3fbff718  
    213213       * Two objects are considered equal if they are both of type HashCash and have an identical string representation
    214214       */
     215  /* FIXME missing hashCode() method FIXME */
     216  @Override
    215217  public boolean equals(Object obj) {
    216218    if(obj instanceof HashCash)
     
    223225       * Returns the canonical string representation of the HashCash
    224226       */
     227  @Override
    225228  public String toString() {
    226229    return myToken;
  • core/java/src/freenet/support/CPUInformation/CPUID.java

    re5eea47 r3fbff718  
    168168    }
    169169    protected static class VIAC3Impl extends CPUIDCPUInfo implements CPUInfo {
     170        @Override
    170171        public boolean IsC3Compatible() { return true; }
    171172        public String getCPUModelString() { return "VIA C3"; }
  • core/java/src/gnu/crypto/hash/BaseHashStandalone.java

    re5eea47 r3fbff718  
    165165   // methods to be implemented by concrete subclasses ------------------------
    166166
     167    @Override
    167168   public abstract Object clone();
    168169
  • core/java/src/gnu/crypto/prng/AsyncFortunaStandalone.java

    re5eea47 r3fbff718  
    4848
    4949    /** the seed is only propogated once the prng is started with startup() */
     50    @Override
    5051    public void seed(byte val[]) {
    5152        Map props = new HashMap(1);
     
    5556    }
    5657 
     58    @Override
    5759    protected void allocBuffer() {}
    5860   
     
    134136    }
    135137
     138    @Override
    136139    public void fillBlock()
    137140    {
  • core/java/src/gnu/crypto/prng/BasePRNGStandalone.java

    re5eea47 r3fbff718  
    173173   // abstract methods to implement by subclasses -----------------------------
    174174
     175  @Override
    175176  public Object clone() throws CloneNotSupportedException
    176177  {
  • core/java/src/gnu/crypto/prng/FortunaStandalone.java

    re5eea47 r3fbff718  
    170170  }
    171171
     172    @Override
    172173  public void addRandomByte(byte b)
    173174  {
     
    178179  }
    179180
     181    @Override
    180182  public void addRandomBytes(byte[] buf, int offset, int length)
    181183  {
     
    245247    }
    246248
     249        @Override
    247250    public final byte nextByte()
    248251    {
     
    252255    }
    253256
     257        @Override
    254258    public final void nextBytes(byte[] out, int offset, int length)
    255259    {
     
    281285    }
    282286
     287        @Override
    283288    public final void addRandomByte(byte b)
    284289    {
     
    286291    }
    287292
     293        @Override
    288294    public final void addRandomBytes(byte[] seed, int offset, int length)
    289295    {
  • core/java/src/net/i2p/client/I2PSessionImpl.java

    re5eea47 r3fbff718  
    7474    protected I2CPMessageReader _reader;
    7575    /** where we pipe our messages */
    76     protected OutputStream _out;
     76    protected /* FIXME final FIXME */OutputStream _out;
    7777
    7878    /** who we send events to */
  • core/java/src/net/i2p/client/I2PSessionImpl2.java

    re5eea47 r3fbff718  
    3434
    3535    /** set of MessageState objects, representing all of the messages in the process of being sent */
    36     private Set _sendingStates;
     36    private /* FIXME final FIXME */ Set _sendingStates;
    3737    /** max # seconds to wait for confirmation of the message send */
    3838    private final static long SEND_TIMEOUT = 60 * 1000; // 60 seconds to send
  • core/java/src/net/i2p/client/I2PSimpleSession.java

    re5eea47 r3fbff718  
    88import java.io.IOException;
    99import java.io.InputStream;
    10 import java.io.OutputStream;
    1110import java.net.Socket;
    1211import java.net.UnknownHostException;
    1312import java.util.Properties;
    14 import java.util.Set;
    1513
    1614import net.i2p.I2PAppContext;
    17 import net.i2p.data.DataHelper;
    1815import net.i2p.data.Destination;
    1916import net.i2p.data.Hash;
     
    2421import net.i2p.data.i2cp.I2CPMessageReader;
    2522import net.i2p.util.I2PThread;
    26 import net.i2p.util.Log;
    2723
    2824/**
     
    3632class I2PSimpleSession extends I2PSessionImpl2 {
    3733    private boolean _destReceived;
    38     private Object _destReceivedLock;
     34    private /* FIXME final FIXME */ Object _destReceivedLock;
    3935    private Destination _destination;
    4036    private boolean _bwReceived;
    41     private Object _bwReceivedLock;
     37    private /* FIXME final FIXME */ Object _bwReceivedLock;
    4238    private int[] _bwLimits;
    4339
     
    6662     *                             not reachable
    6763     */
     64    @Override
    6865    public void connect() throws I2PSessionException {
    6966        _closed = false;
     
    110107    }
    111108
     109    @Override
    112110    public Destination lookupDest(Hash h) throws I2PSessionException {
    113111        if (_closed)
     
    126124    }
    127125
     126    @Override
    128127    public int[] bandwidthLimits() throws I2PSessionException {
    129128        if (_closed)
  • core/java/src/net/i2p/client/MessageState.java

    re5eea47 r3fbff718  
    2222    private String _prefix;
    2323    private MessageId _id;
    24     private Set _receivedStatus;
     24    private final Set _receivedStatus;
    2525    private SessionKey _key;
    2626    private SessionKey _newKey;
  • core/java/src/net/i2p/client/RequestLeaseSetMessageHandler.java

    re5eea47 r3fbff718  
    3535 */
    3636class RequestLeaseSetMessageHandler extends HandlerImpl {
    37     private Map _existingLeaseSets;
     37    private final Map _existingLeaseSets;
    3838
    3939    public RequestLeaseSetMessageHandler(I2PAppContext context) {
  • core/java/src/net/i2p/client/SessionIdleTimer.java

    re5eea47 r3fbff718  
    3737     *  reduce, shutdown, or both must be true
    3838     */
     39    /* FIXME Exporting non-public type through public API FIXME */
    3940    public SessionIdleTimer(I2PAppContext context, I2PSessionImpl session, boolean reduce, boolean shutdown) {
    4041        _context = context;
  • core/java/src/net/i2p/client/naming/LookupDest.java

    re5eea47 r3fbff718  
    1313import net.i2p.client.I2PSimpleClient;
    1414import net.i2p.data.Base32;
    15 import net.i2p.data.Base64;
    1615import net.i2p.data.Destination;
    1716import net.i2p.data.Hash;
    18 import net.i2p.data.LeaseSet;
    1917
    2018/**
  • core/java/src/net/i2p/client/naming/NamingService.java

    re5eea47 r3fbff718  
    2727    private final static Log _log = new Log(NamingService.class);
    2828    protected I2PAppContext _context;
    29     private HashMap _cache;
     29    private /* FIXME final FIXME */ HashMap _cache;
    3030
    3131    /** what classname should be used as the naming service impl? */
  • core/java/src/net/i2p/client/naming/PetNameDB.java

    re5eea47 r3fbff718  
    2424public class PetNameDB {
    2525    /** name (String) to PetName mapping */
    26     private Map _names;
     26    private final Map _names;
    2727    private String _path;
    2828   
  • core/java/src/net/i2p/crypto/CryptixAESKeyCache.java

    re5eea47 r3fbff718  
    1212 */
    1313public final class CryptixAESKeyCache {
    14     private List _availableKeys;
     14    private final List _availableKeys;
    1515   
    1616    private static final int KEYSIZE = 32; // 256bit AES
  • core/java/src/net/i2p/crypto/DHSessionKeyBuilder.java

    re5eea47 r3fbff718  
    5454    private static int MAX_NUM_BUILDERS = -1;
    5555    private static int CALC_DELAY = -1;
     56    /* FIXME this should be final if you syncronize FIXME */
    5657    private static volatile List _builders = new ArrayList(50);
    5758    private static Thread _precalcThread = null;
  • core/java/src/net/i2p/crypto/HMACGenerator.java

    re5eea47 r3fbff718  
    2323    private I2PAppContext _context;
    2424    /** set of available HMAC instances for calculate */
    25     protected List _available;
     25    protected final List _available;
    2626    /** set of available byte[] buffers for verify */
    27     private List _availableTmp;
     27    private final  List _availableTmp;
    2828   
    2929    public HMACGenerator(I2PAppContext context) {
  • core/java/src/net/i2p/crypto/SHA256Generator.java

    re5eea47 r3fbff718  
    1717public final class SHA256Generator {
    1818    private List _digests;
    19     private List _digestsGnu;
     19    private final List _digestsGnu;
    2020    public SHA256Generator(I2PAppContext context) {
    2121        _digests = new ArrayList(32);
  • core/java/src/net/i2p/crypto/TransientSessionKeyManager.java

    re5eea47 r3fbff718  
    3737    private Log _log;
    3838    /** Map allowing us to go from the targeted PublicKey to the OutboundSession used */
    39     private Map<PublicKey, OutboundSession> _outboundSessions;
     39    private final Map<PublicKey, OutboundSession> _outboundSessions;
    4040    /** Map allowing us to go from a SessionTag to the containing TagSet */
    41     private Map<SessionTag, TagSet> _inboundTagSets;
     41    private final Map<SessionTag, TagSet> _inboundTagSets;
    4242    protected I2PAppContext _context;
    4343    private volatile boolean _alive;
     
    8282    private TransientSessionKeyManager() { this(null); }
    8383   
     84    @Override
    8485    public void shutdown() {
    8586         _alive = false;
     
    106107
    107108    /** TagSet */
     109    /* FIXME Exporting non-public type through public API */
    108110    protected Set<TagSet> getInboundTagSets() {
    109111        synchronized (_inboundTagSets) {
     
    113115
    114116    /** OutboundSession */
     117    /* FIXME Exporting non-public type through public API */
    115118    protected Set<OutboundSession> getOutboundSessions() {
    116119        synchronized (_outboundSessions) {
     
    119122    }
    120123
     124    /* FIXME Exporting non-public type through public API */
    121125    protected void setData(Set<TagSet> inboundTagSets, Set<OutboundSession> outboundSessions) {
    122126        if (_log.shouldLog(Log.INFO))
     
    558562        private long _established;
    559563        private long _lastUsed;
    560         private List<TagSet> _tagSets;
     564        private /* FIXME final FIXME */ List<TagSet> _tagSets;
    561565
    562566        public OutboundSession(PublicKey target) {
  • core/java/src/net/i2p/crypto/TrustedUpdate.java

    re5eea47 r3fbff718  
    279279        String versionString = new TrustedUpdate().getVersionString(new File(signedFile));
    280280
    281         if (versionString == "")
     281        if (versionString.equals(""))
    282282            System.out.println("No version string found in file '" + signedFile + "'");
    283283        else
  • core/java/src/net/i2p/crypto/YKGenerator.java

    re5eea47 r3fbff718  
    4444    private static int MAX_NUM_BUILDERS = -1;
    4545    private static int CALC_DELAY = -1;
     46    /* FIXME final type if you are to syncronize FIXME */
    4647    private static volatile List _values = new ArrayList(50); // list of BigInteger[] values (y and k)
    4748    private static Thread _precalcThread = null;
  • core/java/src/net/i2p/data/Hash.java

    re5eea47 r3fbff718  
    3232    private volatile String _stringified;
    3333    private volatile String _base64ed;
    34     private Map _xorCache;
     34    private /* FIXME final FIXME */ Map _xorCache;
    3535
    3636    public final static int HASH_LENGTH = 32;
  • core/java/src/net/i2p/data/PrivateKeyFile.java

    re5eea47 r3fbff718  
    263263    }
    264264
     265    @Override
    265266    public String toString() {
    266267        StringBuilder s = new StringBuilder(128);
  • core/java/src/net/i2p/data/RouterInfo.java

    re5eea47 r3fbff718  
    3737    private RouterIdentity _identity;
    3838    private volatile long _published;
    39     private Set _addresses;
    40     private Set _peers;
    41     private Properties _options;
     39    private final Set _addresses;
     40    private final Set _peers;
     41    private /* FIXME final FIXME */ Properties _options;
    4242    private volatile Signature _signature;
    4343    private volatile Hash _currentRoutingKey;
  • core/java/src/net/i2p/data/i2cp/BandwidthLimitsMessage.java

    re5eea47 r3fbff718  
    8181    }
    8282
     83    /* FIXME missing hashCode() method FIXME */
    8384    @Override
    8485    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/CreateLeaseSetMessage.java

    re5eea47 r3fbff718  
    114114    }
    115115
     116    /* FIXME missing hashCode() method FIXME */
    116117    @Override
    117118    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/CreateSessionMessage.java

    re5eea47 r3fbff718  
    7373    }
    7474
     75    /* FIXME missing hashCode() method FIXME */
    7576    @Override
    7677    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/DestLookupMessage.java

    re5eea47 r3fbff718  
    5959    }
    6060
     61    /* FIXME missing hashCode() method FIXME */
     62    @Override
    6163    public boolean equals(Object object) {
    6264        if ((object != null) && (object instanceof DestLookupMessage)) {
     
    6769    }
    6870
     71    @Override
    6972    public String toString() {
    7073        StringBuilder buf = new StringBuilder();
  • core/java/src/net/i2p/data/i2cp/DestReplyMessage.java

    re5eea47 r3fbff718  
    6161    }
    6262
     63    /* FIXME missing hashCode() method FIXME */
     64    @Override
    6365    public boolean equals(Object object) {
    6466        if ((object != null) && (object instanceof DestReplyMessage)) {
     
    6971    }
    7072
     73    @Override
    7174    public String toString() {
    7275        StringBuilder buf = new StringBuilder();
  • core/java/src/net/i2p/data/i2cp/DestroySessionMessage.java

    re5eea47 r3fbff718  
    8080
    8181    @Override
     82    public int hashCode() {
     83        int hash = 7;
     84        hash = 11 * hash + (this._sessionId != null ? this._sessionId.hashCode() : 0);
     85        return hash;
     86    }
     87
     88    @Override
    8289    public String toString() {
    8390        StringBuilder buf = new StringBuilder();
  • core/java/src/net/i2p/data/i2cp/DisconnectMessage.java

    re5eea47 r3fbff718  
    6565    }
    6666
     67    /* FIXME missing hashCode() method FIXME */
    6768    @Override
    6869    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/GetBandwidthLimitsMessage.java

    re5eea47 r3fbff718  
    3939    }
    4040
     41    /* FIXME missing hashCode() method FIXME */
    4142    @Override
    4243    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/GetDateMessage.java

    re5eea47 r3fbff718  
    4242    }
    4343
     44    /* FIXME missing hashCode() method FIXME */
    4445    @Override
    4546    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/MessagePayloadMessage.java

    re5eea47 r3fbff718  
    110110    }
    111111
     112    /* FIXME missing hashCode() method FIXME */
    112113    @Override
    113114    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/MessageStatusMessage.java

    re5eea47 r3fbff718  
    155155    }
    156156
     157    /* FIXME missing hashCode() method FIXME */
    157158    @Override
    158159    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/ReceiveMessageBeginMessage.java

    re5eea47 r3fbff718  
    9090    }
    9191
     92    /* FIXME missing hashCode() method FIXME */
    9293    @Override
    9394    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/ReceiveMessageEndMessage.java

    re5eea47 r3fbff718  
    7474    }
    7575
     76    /* FIXME missing hashCode() method FIXME */
    7677    @Override
    7778    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/ReconfigureSessionMessage.java

    re5eea47 r3fbff718  
    8181    }
    8282
     83    /* FIXME missing hashCode() method FIXME */
    8384    @Override
    8485    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/ReportAbuseMessage.java

    re5eea47 r3fbff718  
    111111    }
    112112
     113    /* FIXME missing hashCode() method FIXME */
    113114    @Override
    114115    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/RequestLeaseSetMessage.java

    re5eea47 r3fbff718  
    127127    }
    128128
     129    /* FIXME missing hashCode() method FIXME */
    129130    @Override
    130131    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/SendMessageExpiresMessage.java

    re5eea47 r3fbff718  
    2828public class SendMessageExpiresMessage extends SendMessageMessage {
    2929    private final static Log _log = new Log(SendMessageExpiresMessage.class);
     30    /* FIXME hides another field FIXME */
    3031    public final static int MESSAGE_TYPE = 36;
    3132    private SessionId _sessionId;
     
    8889    }
    8990   
     91    @Override
    9092    public int getType() {
    9193        return MESSAGE_TYPE;
    9294    }
    9395
     96    /* FIXME missing hashCode() method FIXME */
    9497    @Override
    9598    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/SendMessageMessage.java

    re5eea47 r3fbff718  
    136136    }
    137137
     138    /* FIXME missing hashCode() method FIXME */
    138139    @Override
    139140    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/SessionConfig.java

    re5eea47 r3fbff718  
    204204    }
    205205
     206    /* FIXME missing hashCode() method FIXME */
    206207    @Override
    207208    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/SessionStatusMessage.java

    re5eea47 r3fbff718  
    8585    }
    8686
     87    /* FIXME missing hashCode method FIXME */
    8788    @Override
    8889    public boolean equals(Object object) {
  • core/java/src/net/i2p/data/i2cp/SetDateMessage.java

    re5eea47 r3fbff718  
    6868    }
    6969
     70    /* FIXME missing hashCode() method */
    7071    @Override
    7172    public boolean equals(Object object) {
  • core/java/src/net/i2p/stat/BufferedStatLog.java

    re5eea47 r3fbff718  
    2121    private I2PAppContext _context;
    2222    private Log _log;
    23     private StatEvent _events[];
     23    private final StatEvent _events[];
    2424    private int _eventNext;
    2525    private int _lastWrite;
    2626    /** flush stat events to disk after this many events (or 30s)*/
    2727    private int _flushFrequency;
    28     private List _statFilters;
     28    private final List _statFilters;
    2929    private String _lastFilters;
    3030    private BufferedWriter _out;
     
    126126   
    127127    private class StatLogWriter implements Runnable {
    128         private SimpleDateFormat _fmt = new SimpleDateFormat("yyyyMMdd HH:mm:ss.SSS");
     128        private final SimpleDateFormat _fmt = new SimpleDateFormat("yyyyMMdd HH:mm:ss.SSS");
    129129        public void run() {
    130130            int writeStart = -1;
  • core/java/src/net/i2p/stat/Frequency.java

    re5eea47 r3fbff718  
    1212    private long _start = now();
    1313    private long _count = 0;
    14     private Object _lock = this; // new Object(); // in case we want to do fancy sync later
     14    private final Object _lock = this; // new Object(); // in case we want to do fancy sync later
    1515
    1616    public Frequency(long period) {
  • core/java/src/net/i2p/stat/FrequencyStat.java

    re5eea47 r3fbff718  
    5959    }
    6060
     61    /* FIXME missing equals() method FIXME */
     62    @Override
    6163    public int hashCode() {
    6264        return _statName.hashCode();
  • core/java/src/net/i2p/stat/Rate.java

    re5eea47 r3fbff718  
    3434
    3535    /** locked during coalesce and addData */
    36     private Object _lock = new Object();
     36    private final Object _lock = new Object();
    3737
    3838    /** in the current (partial) period, what is the total value acrued through all events? */
     
    454454
    455455    @Override
     456    public int hashCode() {
     457        int hash = 5;
     458        hash = 67 * hash + (int)(Double.doubleToLongBits(this._currentTotalValue) ^ (Double.doubleToLongBits(this._currentTotalValue) >>> 32));
     459        hash = 67 * hash + (int)(this._currentEventCount ^ (this._currentEventCount >>> 32));
     460        hash = 67 * hash + (int)(this._currentTotalEventTime ^ (this._currentTotalEventTime >>> 32));
     461        hash = 67 * hash + (int)(Double.doubleToLongBits(this._lastTotalValue) ^ (Double.doubleToLongBits(this._lastTotalValue) >>> 32));
     462        hash = 67 * hash + (int)(this._lastEventCount ^ (this._lastEventCount >>> 32));
     463        hash = 67 * hash + (int)(this._lastTotalEventTime ^ (this._lastTotalEventTime >>> 32));
     464        hash = 67 * hash + (int)(Double.doubleToLongBits(this._extremeTotalValue) ^ (Double.doubleToLongBits(this._extremeTotalValue) >>> 32));
     465        hash = 67 * hash + (int)(this._extremeEventCount ^ (this._extremeEventCount >>> 32));
     466        hash = 67 * hash + (int)(this._extremeTotalEventTime ^ (this._extremeTotalEventTime >>> 32));
     467        hash = 67 * hash + (int)(Double.doubleToLongBits(this._lifetimeTotalValue) ^ (Double.doubleToLongBits(this._lifetimeTotalValue) >>> 32));
     468        hash = 67 * hash + (int)(this._lifetimeEventCount ^ (this._lifetimeEventCount >>> 32));
     469        hash = 67 * hash + (int)(this._lifetimeTotalEventTime ^ (this._lifetimeTotalEventTime >>> 32));
     470        hash = 67 * hash + (int)(this._creationDate ^ (this._creationDate >>> 32));
     471        hash = 67 * hash + (int)(this._period ^ (this._period >>> 32));
     472        return hash;
     473    }
     474
     475    @Override
    456476    public String toString() {
    457477        StringBuilder buf = new StringBuilder(2048);
  • core/java/src/net/i2p/stat/StatManager.java

    re5eea47 r3fbff718  
    2626
    2727    /** stat name to FrequencyStat */
    28     private Map _frequencyStats;
     28    private final Map _frequencyStats;
    2929    /** stat name to RateStat */
    30     private Map _rateStats;
     30    private final Map _rateStats;
    3131    private StatLog _statLog;
    3232
  • core/java/src/net/i2p/time/Timestamper.java

    re5eea47 r3fbff718  
    1919    private I2PAppContext _context;
    2020    private Log _log;
    21     private List<String> _servers;
     21    private final List<String> _servers;
    2222    private List<String> _priorityServers;
    23     private List<UpdateListener> _listeners;
     23    private final List<UpdateListener> _listeners;
    2424    private int _queryFrequency;
    2525    private int _concurringServers;
     
    5353    }
    5454    public Timestamper(I2PAppContext ctx, UpdateListener lsnr, boolean daemon) {
     55        // moved here to prevent problems with synchronized statements.
     56        _servers = new ArrayList(3);
     57        _listeners = new ArrayList(1);
    5558        // Don't bother starting a thread if we are disabled.
    5659        // This means we no longer check every 5 minutes to see if we got enabled,
     
    6669        _initialized = false;
    6770        _wellSynced = false;
    68         _servers = new ArrayList(3);
    69         _listeners = new ArrayList(1);
    7071        if (lsnr != null)
    7172            _listeners.add(lsnr);
  • core/java/src/net/i2p/util/ByteCache.java

    re5eea47 r3fbff718  
    1616 */
    1717public final class ByteCache {
    18     private static Map _caches = new HashMap(16);
     18    private final static Map _caches = new HashMap(16);
    1919    /**
    2020     * Get a cache responsible for objects of the given size
     
    3737    private Log _log;
    3838    /** list of available and available entries */
    39     private List _available;
     39    private final List _available;
    4040    private int _maxCached;
    4141    private int _entrySize;
  • core/java/src/net/i2p/util/Clock.java

    re5eea47 r3fbff718  
    4545    protected volatile long _offset;
    4646    protected boolean _alreadyChanged;
    47     private Set _listeners;
     47    private final Set _listeners;
    4848
    4949    /** if the clock is skewed by 3+ days, fuck 'em */
  • core/java/src/net/i2p/util/ConcurrentHashSet.java

    re5eea47 r3fbff718  
    2424    }
    2525
     26    @Override
    2627    public boolean add(E o) {
    2728        return _map.put(o, DUMMY) == null;
    2829    }
    2930
     31    @Override
    3032    public void clear() {
    3133        _map.clear();
    3234    }
    3335
     36    @Override
    3437    public boolean contains(Object o) {
    3538        return _map.containsKey(o);
    3639    }
    3740
     41    @Override
    3842    public boolean isEmpty() {
    3943        return _map.isEmpty();
    4044    }
    4145
     46    @Override
    4247    public boolean remove(Object o) {
    4348        return _map.remove(o) != null;
     
    5257    }
    5358
     59    @Override
    5460    public boolean addAll(Collection<? extends E> c) {
    5561        boolean rv = false;
  • core/java/src/net/i2p/util/EepGet.java

    re5eea47 r3fbff718  
    4444    private String _postData;
    4545    private boolean _allowCaching;
    46     protected List _listeners;
     46    protected final List _listeners;
    4747   
    4848    private boolean _keepFetching;
     
    257257        private long _lastComplete;
    258258        private boolean _firstTime;
    259         private DecimalFormat _pct = new DecimalFormat("00.0%");
    260         private DecimalFormat _kbps = new DecimalFormat("###,000.00");
     259        private final DecimalFormat _pct = new DecimalFormat("00.0%");
     260        private final DecimalFormat _kbps = new DecimalFormat("###,000.00");
    261261        public CLIStatusListener() {
    262262            this(1024, 40);
  • core/java/src/net/i2p/util/EventDispatcherImpl.java

    re5eea47 r3fbff718  
    3636
    3737    private boolean _ignore = false;
    38     private HashMap _events = new HashMap(4);
    39     private ArrayList _attached = new ArrayList();
     38    private /* FIXME final FIXME */ HashMap _events = new HashMap(4);
     39    private final ArrayList _attached = new ArrayList();
    4040   
    4141    public EventDispatcher getEventDispatcher() {
  • core/java/src/net/i2p/util/Executor.java

    re5eea47 r3fbff718  
    88    private I2PAppContext _context;
    99    private Log _log;
    10     private List _readyEvents;
     10    private final List _readyEvents;
    1111    private SimpleStore runn;
    1212
  • core/java/src/net/i2p/util/I2PAppThread.java

    re5eea47 r3fbff718  
    4444    }
    4545   
     46    @Override
    4647    protected void fireOOM(OutOfMemoryError oom) {
    4748        for (Iterator iter = _threadListeners.iterator(); iter.hasNext(); ) {
  • core/java/src/net/i2p/util/LogConsoleBuffer.java

    re5eea47 r3fbff718  
    1212public class LogConsoleBuffer {
    1313    private I2PAppContext _context;
    14     private List _buffer;
    15     private List _critBuffer;
     14    private final List _buffer;
     15    private final List _critBuffer;
    1616
    1717    public LogConsoleBuffer(I2PAppContext context) {
  • core/java/src/net/i2p/util/LogManager.java

    re5eea47 r3fbff718  
    7171    private File _locationFile;
    7272    /** Ordered list of LogRecord elements that have not been written out yet */
    73     private List _records;
     73    private /* FIXME final FIXME */ List _records;
    7474    /** List of explicit overrides of log levels (LogLimit objects) */
    75     private List _limits;
     75    private /* FIXME final FIXME */ List _limits;
    7676    /** String (scope) to Log object */
    77     private Map _logs;
     77    private /* FIXME final FIXME */ Map _logs;
    7878    /** who clears and writes our records */
    7979    private LogWriter _writer;
  • core/java/src/net/i2p/util/NativeBigInteger.java

    re5eea47 r3fbff718  
    2525
    2626import net.i2p.I2PAppContext;
    27 import net.i2p.util.FileUtil;
    28 import net.i2p.util.Log;
    2927
    3028/**
  • core/java/src/net/i2p/util/OrderedProperties.java

    re5eea47 r3fbff718  
    4141
    4242    /** lock this before touching _order or _data */
    43     private Object _lock = new Object();
     43    private final Object _lock = new Object();
    4444
    4545    public OrderedProperties() {
     
    270270        }
    271271
     272        /* FIXME missing hashCode() method FIXME */
    272273        @Override
    273274        public boolean equals(Object o) {
  • core/java/src/net/i2p/util/ResettableGZIPInputStream.java

    re5eea47 r3fbff718  
    170170        if (0 != (flags & (1<<5))) {
    171171            // extra header, read and ignore
    172             int len = 0;
     172            int _len = 0;
    173173            c = in.read();
    174174            if (c == -1) throw new IOException("EOF reading the extra header");
    175             len = c;
     175            _len = c;
    176176            c = in.read();
    177177            if (c == -1) throw new IOException("EOF reading the extra header");
    178             len += (c << 8);
     178            _len += (c << 8);
    179179           
    180180            // now skip that data
    181             for (int i = 0; i < len; i++) {
     181            for (int i = 0; i < _len; i++) {
    182182                c = in.read();
    183183                if (c == -1) throw new IOException("EOF reading the extra header's body");
  • core/java/src/net/i2p/util/ReusableGZIPInputStream.java

    re5eea47 r3fbff718  
    1515 */
    1616public class ReusableGZIPInputStream extends ResettableGZIPInputStream {
    17     private static ArrayList _available = new ArrayList(8);
     17    private final static ArrayList _available = new ArrayList(8);
    1818    /**
    1919     * Pull a cached instance
  • core/java/src/net/i2p/util/ReusableGZIPOutputStream.java

    re5eea47 r3fbff718  
    1515 */
    1616public class ReusableGZIPOutputStream extends ResettableGZIPOutputStream {
    17     private static ArrayList _available = new ArrayList(16);
     17    private static final ArrayList _available = new ArrayList(16);
    1818    /**
    1919     * Pull a cached instance
  • core/java/src/net/i2p/util/ShellCommand.java

    re5eea47 r3fbff718  
    5252    private class CommandThread extends Thread {
    5353
    54         Object  caller;
     54        final Object  caller;
    5555        boolean consumeOutput;
    5656        String  shellCommand;
  • core/java/src/net/i2p/util/SimpleTimer.java

    re5eea47 r3fbff718  
    2222    private Log _log;
    2323    /** event time (Long) to event (TimedEvent) mapping */
    24     private TreeMap _events;
     24    private final TreeMap _events;
    2525    /** event (TimedEvent) to event time (Long) mapping */
    2626    private Map _eventTimes;
    27     private List _readyEvents;
     27    private final List _readyEvents;
    2828    private SimpleStore runn;
    2929
  • core/java/src/org/bouncycastle/crypto/digests/MD5Digest.java

    re5eea47 r3fbff718  
    105105     * reset the chaining variables to the IV values.
    106106     */
     107    @Override
    107108    public void reset()
    108109    {
  • history.txt

    re5eea47 r3fbff718  
     12009-08-11 sponge
     2    * Code Janitor time! Many fixes and documenting fixes that should be
     3      done in the future. for the most part, this is a general code cleanup.
     4    * On smaller/embedded systems, the "final" keyword cleanups will have
     5      more of an impact than on larger systems.
     6    * Document missing hashCode() methods.
     7    * Unhide more variables to make code easier to read.
     8
    192009-08-11 zzz
    210    * Android:
  • router/java/src/net/i2p/router/RouterVersion.java

    re5eea47 r3fbff718  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 11;
     21    public final static long BUILD = 12;
    2222    /** for example "-test" */
    2323    public final static String EXTRA = "";
  • router/java/src/net/i2p/router/client/ClientConnectionRunner.java

    re5eea47 r3fbff718  
    1919
    2020import net.i2p.crypto.SessionKeyManager;
    21 import net.i2p.crypto.TransientSessionKeyManager;
    2221import net.i2p.data.Destination;
    2322import net.i2p.data.Hash;
     
    115114            t.setPriority(I2PThread.MAX_PRIORITY);
    116115            t.start();
    117             _out = _socket.getOutputStream(); // LINT -- OWCH! needs a better way so it can be final.
     116            _out = _socket.getOutputStream(); // FIXME OWCH! needs a better way so it can be final. FIXME
    118117            _reader.startReading();
    119118        } catch (IOException ioe) {
  • router/java/src/net/i2p/router/client/LeaseRequestState.java

    re5eea47 r3fbff718  
    6161    public void setIsSuccessful(boolean is) { _successful = is; }
    6262
     63    @Override
    6364    public String toString() {
    6465        return "leaseSet request asking for " + _requestedLeaseSet
  • router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java

    re5eea47 r3fbff718  
    214214      * Key the cache on the source+dest pair.
    215215      */
    216     private static HashMap<String, LeaseSet> _leaseSetCache = new HashMap();
     216    private final static HashMap<String, LeaseSet> _leaseSetCache = new HashMap();
    217217    private LeaseSet getReplyLeaseSet(boolean force) {
    218218        LeaseSet newLS = getContext().netDb().lookupLeaseSetLocally(_from.calculateHash());
     
    314314     *
    315315     */
    316     private static HashMap<String, Lease> _leaseCache = new HashMap();
     316    private final static HashMap<String, Lease> _leaseCache = new HashMap();
    317317    private boolean getNextLease() {
    318318        _leaseSet = getContext().netDb().lookupLeaseSetLocally(_to.calculateHash());
     
    454454     * connections like IRC.
    455455     */
    456     private static HashMap<String, Long> _lastReplyRequestCache = new HashMap();
     456    private final static HashMap<String, Long> _lastReplyRequestCache = new HashMap();
    457457
    458458    /**
     
    753753     *
    754754     */
    755     private static HashMap<String, TunnelInfo> _tunnelCache = new HashMap();
     755    private static final HashMap<String, TunnelInfo> _tunnelCache = new HashMap();
    756756    private static HashMap<String, TunnelInfo> _backloggedTunnelCache = new HashMap();
    757757    private TunnelInfo selectOutboundTunnel(Destination to) {
     
    919919        }
    920920       
     921        @Override
    921922        public String toString() {
    922923            return "sending " + _toString + " waiting for token " + _pendingToken
  • router/java/src/net/i2p/router/networkdb/kademlia/ExpireRoutersJob.java

    re5eea47 r3fbff718  
    1010
    1111import java.util.Collections;
    12 import java.util.Date;
    13 import java.util.HashSet;
    1412import java.util.Iterator;
    1513import java.util.Set;
  • router/java/src/net/i2p/router/networkdb/kademlia/FloodfillVerifyStoreJob.java

    re5eea47 r3fbff718  
    66import net.i2p.data.DataStructure;
    77import net.i2p.data.Hash;
    8 import net.i2p.data.LeaseSet;
    9 import net.i2p.data.RouterInfo;
    108import net.i2p.data.i2np.DatabaseLookupMessage;
    119import net.i2p.data.i2np.DatabaseSearchReplyMessage;
  • router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java

    re5eea47 r3fbff718  
    2323import java.util.Properties;
    2424import java.util.Set;
    25 import java.util.TreeMap;
    2625import java.util.TreeSet;
    2726
  • router/java/src/net/i2p/router/networkdb/kademlia/PeerSelector.java

    re5eea47 r3fbff718  
    4343     * @return ordered list of Hash objects
    4444     */
     45    /* FIXME Exporting non-public type through public API FIXME */
    4546    public List selectMostReliablePeers(Hash key, int numClosest, Set alreadyChecked, KBucketSet kbuckets) {// LINT -- Exporting non-public type through public API
    4647        // get the peers closest to the key
     
    5657     * @return List of Hash for the peers selected, ordered by bucket (but intra bucket order is not defined)
    5758     */
     59    /* FIXME Exporting non-public type through public API FIXME */
    5860    public List selectNearestExplicit(Hash key, int maxNumRouters, Set peersToIgnore, KBucketSet kbuckets) {// LINT -- Exporting non-public type through public API
    5961        if (true)
     
    9294     * @return List of Hash for the peers selected, ordered by bucket (but intra bucket order is not defined)
    9395     */
     96    /* FIXME Exporting non-public type through public API FIXME */
    9497    public List selectNearestExplicitThin(Hash key, int maxNumRouters, Set peersToIgnore, KBucketSet kbuckets) { // LINT -- Exporting non-public type through public API
    9598        if (peersToIgnore == null)
     
    196199     * @return List of Hash for the peers selected, ordered by bucket (but intra bucket order is not defined)
    197200     */
     201    /* FIXME Exporting non-public type through public API FIXME */
    198202    public List selectNearest(Hash key, int maxNumRouters, Set peersToIgnore, KBucketSet kbuckets) { // LINT -- Exporting non-public type through public API
    199203        // sure, this may not be exactly correct per kademlia (peers on the border of a kbucket in strict kademlia
  • router/java/src/net/i2p/router/networkdb/kademlia/PersistentDataStore.java

    re5eea47 r3fbff718  
    6464    }
    6565
     66    @Override
    6667    public boolean isInitialized() { return _initialized; }
    6768
     
    7980    }
    8081   
     82    @Override
    8183    public void rescan() {
    8284        if (_initialized)
     
    177179    private class Writer implements Runnable {
    178180        private final Map<Hash, DataStructure>_keys;
    179         private Object _waitLock;
     181        private final Object _waitLock;
    180182        private volatile boolean _quit;
    181183
  • router/java/src/net/i2p/router/networkdb/kademlia/SearchJob.java

    re5eea47 r3fbff718  
    2828import net.i2p.router.RouterContext;
    2929import net.i2p.router.TunnelInfo;
    30 import net.i2p.router.message.SendMessageDirectJob;
    3130import net.i2p.util.Log;
    3231
  • router/java/src/net/i2p/router/peermanager/PeerTestJob.java

    re5eea47 r3fbff718  
    5151    private int getTestConcurrency() { return 1; }
    5252   
    53     public void startTesting(PeerManager manager) { // LINT -- Exporting non-public type through public API
     53    // FIXME Exporting non-public type through public API FIXME
     54    public void startTesting(PeerManager manager) {
    5455        _manager = manager;
    5556        _keepTesting = true;
  • router/java/src/net/i2p/router/startup/WorkingDir.java

    re5eea47 r3fbff718  
    77import java.io.FileWriter;
    88import java.io.IOException;
    9 import java.io.OutputStream;
    109import java.io.PrintWriter;
    1110import java.util.Properties;
  • router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java

    re5eea47 r3fbff718  
    153153    }
    154154   
     155    @Override
    155156    public byte[] getIP(Hash dest) {
    156157        return _manager.getIP(dest);
     
    417418    }
    418419
     420    @Override
    419421    public void queueLookup(byte[] ip) {
    420422        _geoIP.add(ip);
     
    427429     *  @return two-letter lower-case country code or null
    428430     */
     431    @Override
    429432    public String getCountry(Hash peer) {
    430433        byte[] ip = TransportImpl.getIP(peer);
     
    453456
    454457    /** full name for a country code, or the code if we don't know the name */
     458    @Override
    455459    public String getCountryName(String c) {
    456460        if (_geoIP == null)
     
    463467
    464468    /** Provide a consistent "look" for displaying router IDs in the console */
     469    @Override
    465470    public String renderPeerHTML(Hash peer) {
    466471        String h = peer.toBase64().substring(0, 4);
  • router/java/src/net/i2p/router/transport/TransportImpl.java

    re5eea47 r3fbff718  
    2929import net.i2p.router.CommSystemFacade;
    3030import net.i2p.router.Job;
    31 import net.i2p.router.JobImpl;
    3231import net.i2p.router.MessageSelector;
    3332import net.i2p.router.OutNetMessage;
  • router/java/src/net/i2p/router/transport/TransportManager.java

    re5eea47 r3fbff718  
    1414import java.net.UnknownHostException;
    1515import java.util.ArrayList;
    16 import java.util.Arrays;
    1716import java.util.HashMap;
    1817import java.util.Iterator;
     
    404403    }
    405404   
     405    @SuppressWarnings("static-access")
    406406    public TransportBid getNextBid(OutNetMessage msg) {
    407407        int unreachableTransports = 0;
     
    428428            TransportBid bid = t.bid(msg.getTarget(), msg.getMessageSize());
    429429            if (bid != null) {
     430                /* FIXME Accessing static field "TRANSIENT_FAIL" FIXME */
    430431                if (bid.getLatencyMs() == bid.TRANSIENT_FAIL)
    431432                    // this keeps GetBids() from shitlisting for "no common transports"
  • router/java/src/net/i2p/router/transport/UPnP.java

    re5eea47 r3fbff718  
    1515
    1616import org.cybergarage.upnp.Action;
    17 import org.cybergarage.upnp.ActionList;
    18 import org.cybergarage.upnp.Argument;
    1917import org.cybergarage.upnp.ArgumentList;
    2018import org.cybergarage.upnp.ControlPoint;
     
    2321import org.cybergarage.upnp.Service;
    2422import org.cybergarage.upnp.ServiceList;
    25 import org.cybergarage.upnp.ServiceStateTable;
    26 import org.cybergarage.upnp.StateVariable;
    2723import org.cybergarage.upnp.device.DeviceChangeListener;
    2824import org.cybergarage.upnp.event.EventListener;
     
    374370        private Service _lastService;
    375371        private ArgumentList _lastArgumentList;
    376         private Object toStringLock = new Object();
     372        private final Object toStringLock = new Object();
    377373        private String toString(String action, String arg, Service serv) {
    378374                synchronized(toStringLock) {
  • router/java/src/net/i2p/router/transport/UPnPManager.java

    re5eea47 r3fbff718  
    1010import java.util.Set;
    1111
    12 import net.i2p.data.RouterAddress;
    1312import net.i2p.router.RouterContext;
    1413import net.i2p.util.Log;
  • router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java

    re5eea47 r3fbff718  
    77import java.nio.channels.SocketChannel;
    88import java.util.ArrayList;
    9 import java.util.Collections;
    109import java.util.Iterator;
    1110import java.util.List;
     
    1413import net.i2p.data.Base64;
    1514import net.i2p.data.DataHelper;
    16 import net.i2p.data.Hash;
    1715import net.i2p.data.RouterIdentity;
    1816import net.i2p.data.RouterInfo;
     
    2523import net.i2p.router.Router;
    2624import net.i2p.router.RouterContext;
    27 import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade;
    2825import net.i2p.router.transport.FIFOBandwidthLimiter;
    2926import net.i2p.util.Log;
  • router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java

    re5eea47 r3fbff718  
    556556     *  NTCP address when it transitions to OK.
    557557     */
     558    @Override
    558559    public void forwardPortStatus(int port, boolean success, String reason) {
    559560        if (_log.shouldLog(Log.WARN)) {
     
    565566    }
    566567
     568    @Override
    567569    public int getRequestedPort() {
    568570        // would be nice to do this here but we can't easily get to the UDP transport.getRequested_Port()
     
    582584     * that the reachability status is really just the UDP status.
    583585     */
     586    @Override
    584587    public short getReachabilityStatus() {
    585588        if (isAlive() && _myAddress != null) {
  • router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java

    re5eea47 r3fbff718  
    675675    }
    676676   
    677     public void receiveRelayResponse(RemoteHostId bob, UDPPacketReader reader) {// LINT -- Exporting non-public type through public API
     677    /* FIXME Exporting non-public type through public API FIXME */
     678    public void receiveRelayResponse(RemoteHostId bob, UDPPacketReader reader) {
    678679        long nonce = reader.getRelayResponseReader().readNonce();
    679680        OutboundEstablishState state = null;
  • router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java

    re5eea47 r3fbff718  
    211211
    212212    /** RemoteHostId, uniquely identifies an attempt */
    213     public RemoteHostId getRemoteHostId() { return _remoteHostId; }// LINT -- Exporting non-public type through public API
     213    // FIXME Exporting non-public type through public API FIXME
     214    public RemoteHostId getRemoteHostId() { return _remoteHostId; }
    214215
    215216    public synchronized void receiveSessionConfirmed(UDPPacketReader.SessionConfirmedReader conf) {
  • router/java/src/net/i2p/router/transport/udp/IntroductionManager.java

    re5eea47 r3fbff718  
    158158    }
    159159   
    160     public void receiveRelayIntro(RemoteHostId bob, UDPPacketReader reader) {// LINT -- Exporting non-public type through public API
     160    /* FIXME Exporting non-public type through public API FIXME */
     161    public void receiveRelayIntro(RemoteHostId bob, UDPPacketReader reader) {
    161162        if (_context.router().isHidden())
    162163            return;
     
    167168    }
    168169   
    169     public void receiveRelayRequest(RemoteHostId alice, UDPPacketReader reader) {// LINT -- Exporting non-public type through public API
     170    /* FIXME Exporting non-public type through public API FIXME */
     171    public void receiveRelayRequest(RemoteHostId alice, UDPPacketReader reader) {
    170172        if (_context.router().isHidden())
    171173            return;
  • router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java

    re5eea47 r3fbff718  
    414414
    415415    /** uniquely identifies an attempt */
    416     public RemoteHostId getRemoteHostId() { return _remoteHostId; }// LINT -- Exporting non-public type through public API
     416    /* FIXME Exporting non-public type through public API FIXME */
     417    public RemoteHostId getRemoteHostId() { return _remoteHostId; }
    417418
    418419    /** we have received a real data packet, so we're done establishing */
  • router/java/src/net/i2p/router/transport/udp/PacketBuilder.java

    re5eea47 r3fbff718  
    880880    private static final byte PEER_RELAY_INTRO_FLAG_BYTE = (UDPPacket.PAYLOAD_TYPE_RELAY_INTRO << 4);
    881881   
    882     public UDPPacket buildRelayIntro(RemoteHostId alice, PeerState charlie, UDPPacketReader.RelayRequestReader request) {// LINT -- Exporting non-public type through public API
     882    /* FIXME Exporting non-public type through public API FIXME */
     883    public UDPPacket buildRelayIntro(RemoteHostId alice, PeerState charlie, UDPPacketReader.RelayRequestReader request) {
    883884        UDPPacket packet = UDPPacket.acquire(_context, false);
    884885        byte data[] = packet.getPacket().getData();
     
    930931    private static final byte PEER_RELAY_RESPONSE_FLAG_BYTE = (UDPPacket.PAYLOAD_TYPE_RELAY_RESPONSE << 4);
    931932   
    932     public UDPPacket buildRelayResponse(RemoteHostId alice, PeerState charlie, long nonce, SessionKey aliceIntroKey) {// LINT -- Exporting non-public type through public API
     933    /* FIXME Exporting non-public type through public API FIXME */
     934    public UDPPacket buildRelayResponse(RemoteHostId alice, PeerState charlie, long nonce, SessionKey aliceIntroKey) {
    933935        InetAddress aliceAddr = null;
    934936        try {
  • router/java/src/net/i2p/router/transport/udp/PacketHandler.java

    re5eea47 r3fbff718  
    3737    private static final long GRACE_PERIOD = Router.CLOCK_FUDGE_FACTOR + 30*1000;
    3838   
    39    
     39    /* FIXME Exporting non-public type through public API FIXME */
    4040    public PacketHandler(RouterContext ctx, UDPTransport transport, UDPEndpoint endpoint, EstablishmentManager establisher, InboundMessageFragments inbound, PeerTestManager testManager, IntroductionManager introManager) {// LINT -- Exporting non-public type through public API
    4141        _context = ctx;
  • router/java/src/net/i2p/router/transport/udp/PeerState.java

    re5eea47 r3fbff718  
    10041004    }
    10051005   
    1006     public RemoteHostId getRemoteHostId() { return _remoteHostId; }// LINT -- Exporting non-public type through public API
     1006    /* FIXME Exporting non-public type through public API FIXME */
     1007    public RemoteHostId getRemoteHostId() { return _remoteHostId; }
    10071008   
    10081009    public int add(OutboundMessageState state) {
  • router/java/src/net/i2p/router/transport/udp/UDPPacket.java

    re5eea47 r3fbff718  
    125125    int getFragmentCount() { return _fragmentCount; }
    126126    void setFragmentCount(int count) { _fragmentCount = count; }
    127    
    128     public RemoteHostId getRemoteHost() {// LINT -- Exporting non-public type through public API
     127
     128    // FIXME Exporting non-public type through public API FIXME
     129    public RemoteHostId getRemoteHost() {
    129130        if (_remoteHost == null) {
    130131            long before = System.currentTimeMillis();
  • router/java/src/net/i2p/router/transport/udp/UDPReceiver.java

    re5eea47 r3fbff718  
    1010import net.i2p.util.I2PThread;
    1111import net.i2p.util.Log;
    12 import net.i2p.util.SimpleScheduler;
    1312import net.i2p.util.SimpleTimer;
    1413
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    re5eea47 r3fbff718  
    4141 */
    4242public class UDPTransport extends TransportImpl implements TimedWeightedPriorityMessageQueue.FailedListener {
    43     private RouterContext _context; // LINT -- field hides a field
     43    private RouterContext _rContext;
    4444    private Log _log;
    4545    private UDPEndpoint _endpoint;
     
    323323    public InetAddress getLocalAddress() { return _externalListenHost; }
    324324    public int getExternalPort() { return _externalListenPort; }
     325    @Override
    325326    public int getRequestedPort() {
    326327        if (_externalListenPort > 0)
     
    347348     * @param port 0 if unknown
    348349     */
     350    @Override
    349351    public void externalAddressReceived(String source, byte[] ip, int port) {
    350352        String s = RemoteHostId.toString(ip);
     
    369371     *  Don't do anything if UPnP claims failure.
    370372     */
     373    @Override
    371374    public void forwardPortStatus(int port, boolean success, String reason) {
    372375        if (_log.shouldLog(Log.WARN)) {
     
    519522     * if no state exists
    520523     */
    521     public PeerState getPeerState(RemoteHostId hostInfo) { // LINT -- Exporting non-public type through public API
     524    /* FIXME Exporting non-public type through public API FIXME */
     525    public PeerState getPeerState(RemoteHostId hostInfo) {
    522526        synchronized (_peersByRemoteHost) {
    523527            return (PeerState)_peersByRemoteHost.get(hostInfo);
     
    756760    }
    757761   
    758     public boolean isInDropList(RemoteHostId peer) { synchronized (_dropList) { return _dropList.contains(peer); } }// LINT -- Exporting non-public type through public API
     762    /* FIXME Exporting non-public type through public API FIXME */
     763    public boolean isInDropList(RemoteHostId peer) { synchronized (_dropList) { return _dropList.contains(peer); } }
    759764   
    760765    void dropPeer(Hash peer, boolean shouldShitlist, String why) {
     
    21832188    }
    21842189    private static final String PROP_REACHABILITY_STATUS_OVERRIDE = "i2np.udp.status";
     2190    @Override
    21852191    public short getReachabilityStatus() {
    21862192        String override = _context.getProperty(PROP_REACHABILITY_STATUS_OVERRIDE);
     
    22022208    }
    22032209   
    2204     public PeerState pickTestPeer(RemoteHostId dontInclude) {// LINT -- Exporting non-public type through public API
     2210    /* FIXME Exporting non-public type through public API FIXME */
     2211    public PeerState pickTestPeer(RemoteHostId dontInclude) {
    22052212        List peers = null;
    22062213        synchronized (_peersByIdent) {
  • router/java/src/net/i2p/router/tunnel/TunnelGateway.java

    re5eea47 r3fbff718  
    4343    protected long _lastFlush;
    4444    protected int _flushFrequency;
    45     protected DelayedFlush _delayedFlush;// LINT -- Exporting non-public type through public API
     45    protected DelayedFlush _delayedFlush;// FIXME Exporting non-public type through public API FIXME
    4646    protected int _messagesSent;
    4747   
  • router/java/src/net/i2p/router/tunnel/TunnelGatewayZeroHop.java

    re5eea47 r3fbff718  
    1313 */
    1414public class TunnelGatewayZeroHop extends TunnelGateway {
    15     private RouterContext _context; // LINT -- field hides a field
    16     private Log _log; // LINT -- field hides a field
     15    private RouterContext TunnelContext;
     16    private Log TunnelLog;
    1717    private TunnelCreatorConfig _config;
    1818    private OutboundMessageDistributor _outDistributor;
     
    2424    public TunnelGatewayZeroHop(RouterContext context, TunnelCreatorConfig config) {
    2525        super(context, null, null, null);
    26         _context = context;
    27         _log = context.logManager().getLog(TunnelGatewayZeroHop.class);
     26        TunnelContext = context;
     27        TunnelLog = context.logManager().getLog(TunnelGatewayZeroHop.class);
    2828        _config = config;
    2929        if (config.isInbound())
    30             _inDistributor = new InboundMessageDistributor(_context, config.getDestination());
     30            _inDistributor = new InboundMessageDistributor(TunnelContext, config.getDestination());
    3131        else
    3232            _outDistributor = new OutboundMessageDistributor(context, 400);
     
    5454    @Override
    5555    public void add(I2NPMessage msg, Hash toRouter, TunnelId toTunnel) {
    56         if (_log.shouldLog(Log.DEBUG))
    57             _log.debug("zero hop gateway: distribute " + (_config.isInbound() ? "inbound " : " outbound ")
     56        if (TunnelLog.shouldLog(Log.DEBUG))
     57            TunnelLog.debug("zero hop gateway: distribute " + (_config.isInbound() ? "inbound " : " outbound ")
    5858                       + " to " + (toRouter != null ? toRouter.toBase64().substring(0,4) : "" )
    5959                       + "." + (toTunnel != null ? toTunnel.getTunnelId() + "" : "")
  • router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java

    re5eea47 r3fbff718  
    5252        // Get stat manager, get recognized bandwidth tiers
    5353        StatManager statMgr = _context.statManager();
    54         String bwTiers = _context.router().getRouterInfo().BW_CAPABILITY_CHARS; // LINT -- Accessing static field "BW_CAPABILITY_CHARS"
     54        @SuppressWarnings("static-access")
     55        /* FIXME Accessing static field "BW_CAPABILITY_CHARS" FIXME */
     56        String bwTiers = _context.router().getRouterInfo().BW_CAPABILITY_CHARS;
    5557        // For each bandwidth tier, create tunnel build agree/reject/expire stats
    5658        for (int i = 0; i < bwTiers.length(); i++) {
  • router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java

    re5eea47 r3fbff718  
    468468    }
    469469   
     470    @SuppressWarnings("static-access")
    470471    private void handleReq(RouterInfo nextPeerInfo, BuildMessageState state, BuildRequestRecord req, Hash nextPeer) {
    471472        long ourId = req.readReceiveTunnelId();
     
    627628            // (enough layers jrandom?)
    628629            TunnelBuildReplyMessage replyMsg = new TunnelBuildReplyMessage(_context);
    629             for (int i = 0; i < state.msg.RECORD_COUNT; i++) // LINT -- Accessing Static field "RECORD_COUNT"
     630            /* FIXME Accessing static field "RECORD_COUNT" FIXME */
     631            for (int i = 0; i < state.msg.RECORD_COUNT; i++)
    630632                replyMsg.setRecord(i, state.msg.getRecord(i));
    631633            replyMsg.setUniqueId(req.readReplyMessageId());
  • router/java/src/net/i2p/router/tunnel/pool/PooledTunnelCreatorConfig.java

    re5eea47 r3fbff718  
    8080   
    8181
    82     public void setTestJob(TestJob job) { _testJob = job; } // LINT -- Exporting non-public type through public API
     82    /* FIXME Exporting non-public type through public API FIXME */
     83    public void setTestJob(TestJob job) { _testJob = job; }
    8384    public void setExpireJob(Job job) { /* _expireJob = job; */ }
    8485   
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java

    re5eea47 r3fbff718  
    1212import java.util.Map;
    1313import java.util.Set;
    14 import java.util.concurrent.ConcurrentHashMap;
    1514
    1615import net.i2p.data.DataHelper;
  • router/java/src/org/cybergarage/http/Date.java

    re5eea47 r3fbff718  
    137137        {
    138138                // Thanks for Theo Beisch (10/20/04)
    139                 Calendar cal = getCalendar();
     139                Calendar _cal = getCalendar();
    140140                return
    141                         toWeekString(cal.get(Calendar.DAY_OF_WEEK)) +", " +
    142                         toTimeString(cal.get(Calendar.DATE)) + " " +
    143                         toMonthString(cal.get(Calendar.MONTH)) + " " +
    144                         Integer.toString(cal.get(Calendar.YEAR)) + " " +
    145                         toTimeString(cal.get(Calendar.HOUR_OF_DAY)) + ":" +
    146                         toTimeString(cal.get(Calendar.MINUTE)) + ":" +
    147                         toTimeString(cal.get(Calendar.SECOND)) + " GMT";
     141                        toWeekString(_cal.get(Calendar.DAY_OF_WEEK)) +", " +
     142                        toTimeString(_cal.get(Calendar.DATE)) + " " +
     143                        toMonthString(_cal.get(Calendar.MONTH)) + " " +
     144                        Integer.toString(_cal.get(Calendar.YEAR)) + " " +
     145                        toTimeString(_cal.get(Calendar.HOUR_OF_DAY)) + ":" +
     146                        toTimeString(_cal.get(Calendar.MINUTE)) + ":" +
     147                        toTimeString(_cal.get(Calendar.SECOND)) + " GMT";
    148148        }
    149149
     
    155155        {
    156156                // Thanks for Theo Beisch (10/20/04)
    157                 Calendar cal = getCalendar();
     157                Calendar _cal = getCalendar();
    158158                return
    159                         toDateString(cal.get(Calendar.HOUR_OF_DAY)) +
    160                         (((cal.get(Calendar.SECOND) % 2) == 0) ? ":" : " ") +
    161                         toDateString(cal.get(Calendar.MINUTE));
     159                        toDateString(_cal.get(Calendar.HOUR_OF_DAY)) +
     160                        (((_cal.get(Calendar.SECOND) % 2) == 0) ? ":" : " ") +
     161                        toDateString(_cal.get(Calendar.MINUTE));
    162162        }
    163163               
  • router/java/src/org/cybergarage/http/HTTPHeader.java

    re5eea47 r3fbff718  
    4343                if (colonIdx < 0)
    4444                        return;
    45                 String name = new String(lineStr.getBytes(), 0, colonIdx);                             
    46                 String value = new String(lineStr.getBytes(), colonIdx+1, lineStr.length()-colonIdx-1);                         
    47                 setName(name.trim());
    48                 setValue(value.trim());
     45                String _name = new String(lineStr.getBytes(), 0, colonIdx);
     46                String _value = new String(lineStr.getBytes(), colonIdx+1, lineStr.length()-colonIdx-1);
     47                setName(_name.trim());
     48                setValue(_value.trim());
    4949        }
    5050
  • router/java/src/org/cybergarage/http/HTTPPacket.java

    re5eea47 r3fbff718  
    135135                        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
    136136                       
    137                         String firstLine = reader.readLine();
    138                         if (firstLine == null || firstLine.length() <= 0)
     137                        String _firstLine = reader.readLine();
     138                        if (_firstLine == null || _firstLine.length() <= 0)
    139139                                return false;
    140                         setFirstLine(firstLine);
     140                        setFirstLine(_firstLine);
    141141                       
    142142                        // Thanks for Giordano Sassaroli <sassarol@cefriel.it> (09/03/03)
    143                         HTTPStatus httpStatus = new HTTPStatus(firstLine);
     143                        HTTPStatus httpStatus = new HTTPStatus(_firstLine);
    144144                        int statCode = httpStatus.getStatusCode();
    145145                        if (statCode == HTTPStatus.CONTINUE){
     
    187187                                        contentLen = Long.parseLong(new String(chunkSizeLine.getBytes(), 0, chunkSizeLine.length()-2));
    188188                                }
    189                                 catch (Exception e) {};
     189                                catch (Exception e) {}
    190190                        }
    191191                        else
     
    232232                                        catch (Exception e) {
    233233                                                contentLen = 0;
    234                                         };
     234                                        }
    235235                                }
    236236                                else
     
    651651                        range[0] = Long.parseLong(firstPosStr);
    652652                }
    653                 catch (NumberFormatException e) {};
     653                catch (NumberFormatException e) {}
    654654                if (strToken.hasMoreTokens() == false)
    655655                        return range;
     
    658658                        range[1] = Long.parseLong(lastPosStr);
    659659                }
    660                 catch (NumberFormatException e) {};
     660                catch (NumberFormatException e) {}
    661661                if (strToken.hasMoreTokens() == false)
    662662                        return range;
     
    665665                        range[2] = Long.parseLong(lengthStr);
    666666                }
    667                 catch (NumberFormatException e) {};
     667                catch (NumberFormatException e) {}
    668668                return range;
    669669        }
  • router/java/src/org/cybergarage/http/HTTPRequest.java

    re5eea47 r3fbff718  
    167167        {
    168168                ParameterList paramList = new ParameterList();
    169                 String uri = getURI();
    170                 if (uri == null)
     169                String _uri = getURI();
     170                if (_uri == null)
    171171                        return paramList;
    172                 int paramIdx = uri.indexOf('?');
     172                int paramIdx = _uri.indexOf('?');
    173173                if (paramIdx < 0)
    174174                        return paramList;
    175175                while (0 < paramIdx) {
    176                         int eqIdx = uri.indexOf('=', (paramIdx+1));
    177                         String name = uri.substring(paramIdx+1, eqIdx);
    178                         int nextParamIdx = uri.indexOf('&', (eqIdx+1));
    179                         String value = uri.substring(eqIdx+1, (0 < nextParamIdx) ? nextParamIdx : uri.length());
     176                        int eqIdx = _uri.indexOf('=', (paramIdx+1));
     177                        String name = _uri.substring(paramIdx+1, eqIdx);
     178                        int nextParamIdx = _uri.indexOf('&', (eqIdx+1));
     179                        String value = _uri.substring(eqIdx+1, (0 < nextParamIdx) ? nextParamIdx : _uri.length());
    180180                        Parameter param = new Parameter(name, value);
    181181                        paramList.add(param);
     
    438438                                try {
    439439                                        in.close();
    440                                 } catch (Exception e) {};
     440                                } catch (Exception e) {}
    441441                                if (in != null)
    442442                                try {
    443443                                        out.close();
    444                                 } catch (Exception e) {};
     444                                } catch (Exception e) {}
    445445                                if (out != null)
    446446                                try {
    447447                                        postSocket.close();
    448                                 } catch (Exception e) {};
     448                                } catch (Exception e) {}
    449449                                postSocket = null;
    450450                        }
     
    495495        ////////////////////////////////////////////////
    496496       
     497    @Override
    497498        public String toString()
    498499        {
  • router/java/src/org/cybergarage/http/HTTPResponse.java

    re5eea47 r3fbff718  
    9898        ////////////////////////////////////////////////
    9999       
     100    @Override
    100101        public String toString()
    101102        {
  • router/java/src/org/cybergarage/http/HTTPServerThread.java

    re5eea47 r3fbff718  
    3838        ////////////////////////////////////////////////
    3939
     40    @Override
    4041        public void run()
    4142        {
  • router/java/src/org/cybergarage/http/HTTPSocket.java

    re5eea47 r3fbff718  
    4646        }
    4747       
     48    @Override
    4849        public void finalize()
    4950        {
  • router/java/src/org/cybergarage/net/HostInterface.java

    re5eea47 r3fbff718  
    102102                        }
    103103                }
    104                 catch(Exception e){};
     104                catch(Exception e){}
    105105                return nHostAddrs;
    106106        }
     
    132132                        }
    133133                }
    134                 catch(Exception e){};
     134                catch(Exception e){}
    135135                return "";
    136136        }
  • router/java/src/org/cybergarage/soap/SOAPRequest.java

    re5eea47 r3fbff718  
    9090                        ByteArrayInputStream byteIn = new ByteArrayInputStream(content);
    9191                        Parser xmlParser = SOAP.getXMLParser();
    92                         Node rootNode = xmlParser.parse(byteIn);
    93                         soapRes.setEnvelopeNode(rootNode);
     92                        Node _rootNode = xmlParser.parse(byteIn);
     93                        soapRes.setEnvelopeNode(_rootNode);
    9494                }
    9595                catch (Exception e) {
     
    171171        ////////////////////////////////////////////////
    172172       
     173    @Override
    173174        public void print()
    174175        {
  • router/java/src/org/cybergarage/soap/SOAPResponse.java

    re5eea47 r3fbff718  
    180180        ////////////////////////////////////////////////
    181181       
     182    @Override
    182183        public void print()
    183184        {
  • router/java/src/org/cybergarage/upnp/Action.java

    re5eea47 r3fbff718  
    273273                }
    274274                else {
    275                         UPnPStatus upnpStatus = getStatus();
    276                         actionRes.setFaultResponse(upnpStatus.getCode(), upnpStatus.getDescription());
     275                        UPnPStatus _upnpStatus = getStatus();
     276                        actionRes.setFaultResponse(_upnpStatus.getCode(), _upnpStatus.getDescription());
    277277                }
    278278                if (Debug.isOn() == true)
  • router/java/src/org/cybergarage/upnp/ControlPoint.java

    re5eea47 r3fbff718  
    132132        }
    133133
     134    @Override
    134135        public void finalize()
    135136        {
     
    507508        {
    508509                SSDPSearchRequest msReq = new SSDPSearchRequest(target, mx);
    509                 SSDPSearchResponseSocketList ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
    510                 ssdpSearchResponseSocketList.post(msReq);
     510                SSDPSearchResponseSocketList _ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
     511                _ssdpSearchResponseSocketList.post(msReq);
    511512        }
    512513
     
    791792                int retryCnt = 0;
    792793                int bindPort = getHTTPPort();
    793                 HTTPServerList httpServerList = getHTTPServerList();
    794                 while (httpServerList.open(bindPort) == false) {
     794                HTTPServerList _httpServerList = getHTTPServerList();
     795                while (_httpServerList.open(bindPort) == false) {
    795796                        retryCnt++;
    796797                        if (UPnP.SERVER_RETRY_COUNT < retryCnt) {
     
    803804                        bindPort = getHTTPPort();
    804805                }
    805                 httpServerList.addRequestListener(this);
    806                 httpServerList.start();
     806                _httpServerList.addRequestListener(this);
     807                _httpServerList.start();
    807808               
    808809                ////////////////////////////////////////
     
    810811                ////////////////////////////////////////
    811812               
    812                 SSDPNotifySocketList ssdpNotifySocketList = getSSDPNotifySocketList();
    813                 if (ssdpNotifySocketList.open() == false) {
     813                SSDPNotifySocketList _ssdpNotifySocketList = getSSDPNotifySocketList();
     814                if (_ssdpNotifySocketList.open() == false) {
    814815                        Debug.warning("Failed to open SSDP notify port 1900");
    815816                        return false;
    816817                }
    817                 ssdpNotifySocketList.setControlPoint(this);                     
    818                 ssdpNotifySocketList.start();
     818                _ssdpNotifySocketList.setControlPoint(this);
     819                _ssdpNotifySocketList.start();
    819820               
    820821                ////////////////////////////////////////
     
    822823                ////////////////////////////////////////
    823824               
    824                 int ssdpPort = getSSDPPort();
     825                int _ssdpPort = getSSDPPort();
    825826                retryCnt = 0;
    826                 SSDPSearchResponseSocketList ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
    827                 while (ssdpSearchResponseSocketList.open(ssdpPort) == false) {
     827                SSDPSearchResponseSocketList _ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
     828                while (_ssdpSearchResponseSocketList.open(_ssdpPort) == false) {
    828829                        retryCnt++;
    829830                        if (UPnP.SERVER_RETRY_COUNT < retryCnt) {
    830                                 Debug.warning("Failed to open SSDP search response port " + ssdpPort);
     831                                Debug.warning("Failed to open SSDP search response port " + _ssdpPort);
    831832                                return false;
    832833                        }
    833834                        // I2P go down not up so we don't run into other I2P things
    834                         setSSDPPort(ssdpPort - 1);
    835                         ssdpPort = getSSDPPort();
    836                 }
    837                 ssdpSearchResponseSocketList.setControlPoint(this);
    838                 ssdpSearchResponseSocketList.start();
     835                        setSSDPPort(_ssdpPort - 1);
     836                        _ssdpPort = getSSDPPort();
     837                }
     838                _ssdpSearchResponseSocketList.setControlPoint(this);
     839                _ssdpSearchResponseSocketList.start();
    839840
    840841                ////////////////////////////////////////
     
    879880                unsubscribe();
    880881               
    881                 SSDPNotifySocketList ssdpNotifySocketList = getSSDPNotifySocketList();
    882                 ssdpNotifySocketList.stop();
    883                 ssdpNotifySocketList.close();
    884                 ssdpNotifySocketList.clear();
    885                
    886                 SSDPSearchResponseSocketList ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
    887                 ssdpSearchResponseSocketList.stop();
    888                 ssdpSearchResponseSocketList.close();
    889                 ssdpSearchResponseSocketList.clear();
    890 
    891                 HTTPServerList httpServerList = getHTTPServerList();
    892                 httpServerList.stop();
    893                 httpServerList.close();
    894                 httpServerList.clear();
     882                SSDPNotifySocketList _ssdpNotifySocketList = getSSDPNotifySocketList();
     883                _ssdpNotifySocketList.stop();
     884                _ssdpNotifySocketList.close();
     885                _ssdpNotifySocketList.clear();
     886               
     887                SSDPSearchResponseSocketList _ssdpSearchResponseSocketList = getSSDPSearchResponseSocketList();
     888                _ssdpSearchResponseSocketList.stop();
     889                _ssdpSearchResponseSocketList.close();
     890                _ssdpSearchResponseSocketList.clear();
     891
     892                HTTPServerList _httpServerList = getHTTPServerList();
     893                _httpServerList.stop();
     894                _httpServerList.close();
     895                _httpServerList.clear();
    895896                       
    896897                ////////////////////////////////////////
  • router/java/src/org/cybergarage/upnp/Device.java

    re5eea47 r3fbff718  
    286286        public Device getRootDevice()
    287287        {
    288                 Node rootNode = getRootNode();
    289                 if (rootNode == null)
     288                Node _rootNode = getRootNode();
     289                if (_rootNode == null)
    290290                        return null;
    291                 Node devNode = rootNode.getNode(Device.ELEM_NAME);
     291                Node devNode = _rootNode.getNode(Device.ELEM_NAME);
    292292                if (devNode == null)
    293293                        return null;
    294                 return new Device(rootNode, devNode);
     294                return new Device(_rootNode, devNode);
    295295        }
    296296
  • router/java/src/org/cybergarage/upnp/Service.java

    re5eea47 r3fbff718  
    397397                if (actionListNode == null)
    398398                        return actionList;
    399                 Node serviceNode = getServiceNode();
     399                Node _serviceNode = getServiceNode();
    400400                int nNode = actionListNode.getNNodes();
    401401                for (int n=0; n<nNode; n++) {
     
    403403                        if (Action.isActionNode(node) == false)
    404404                                continue;
    405                         Action action = new Action(serviceNode, node);
     405                        Action action = new Action(_serviceNode, node);
    406406                        actionList.add(action);
    407407                }
     
    434434                if (stateTableNode == null)
    435435                        return stateTable;
    436                 Node serviceNode = getServiceNode();
     436                Node _serviceNode = getServiceNode();
    437437                int nNode = stateTableNode.getNNodes();
    438438                for (int n=0; n<nNode; n++) {
     
    440440                        if (StateVariable.isStateVariableNode(node) == false)
    441441                                continue;
    442                         StateVariable serviceVar = new StateVariable(serviceNode, node);
     442                        StateVariable serviceVar = new StateVariable(_serviceNode, node);
    443443                        stateTable.add(serviceVar);
    444444                }
  • router/java/src/org/cybergarage/upnp/ServiceList.java

    re5eea47 r3fbff718  
    4747                        obj = get(n);
    4848                }
    49                 catch (Exception e) {};
     49                catch (Exception e) {}
    5050                return (Service)obj;
    5151        }
  • router/java/src/org/cybergarage/upnp/StateVariable.java

    re5eea47 r3fbff718  
    7373        public Service getService()
    7474        {
    75                 Node serviceNode = getServiceNode();
    76                 if (serviceNode == null)
     75                Node _serviceNode = getServiceNode();
     76                if (_serviceNode == null)
    7777                        return null;
    78                 return new Service(serviceNode);
     78                return new Service(_serviceNode);
    7979        }
    8080
     
    302302                }
    303303                else {
    304                         UPnPStatus upnpStatus = retVar.getStatus();
    305                         queryRes.setFaultResponse(upnpStatus.getCode(), upnpStatus.getDescription());
     304                        UPnPStatus _upnpStatus = retVar.getStatus();
     305                        queryRes.setFaultResponse(_upnpStatus.getCode(), _upnpStatus.getDescription());
    306306                }
    307307                queryReq.post(queryRes);
  • router/java/src/org/cybergarage/upnp/control/RenewSubscriber.java

    re5eea47 r3fbff718  
    5252        ////////////////////////////////////////////////
    5353       
     54    @Override
    5455        public void run()
    5556        {
  • router/java/src/org/cybergarage/upnp/device/Advertiser.java

    re5eea47 r3fbff718  
    5252        ////////////////////////////////////////////////
    5353       
     54    @Override
    5455        public void run()
    5556        {
  • router/java/src/org/cybergarage/upnp/device/Disposer.java

    re5eea47 r3fbff718  
    5050        ////////////////////////////////////////////////
    5151       
     52    @Override
    5253        public void run()
    5354        {
  • router/java/src/org/cybergarage/upnp/ssdp/HTTPMUSocket.java

    re5eea47 r3fbff718  
    5454        }
    5555
     56    @Override
    5657        protected void finalize()
    5758        {
  • router/java/src/org/cybergarage/upnp/ssdp/HTTPUSocket.java

    re5eea47 r3fbff718  
    6161        }
    6262
     63    @Override
    6364        protected void finalize()
    6465        {
  • router/java/src/org/cybergarage/upnp/ssdp/SSDPNotifySocket.java

    re5eea47 r3fbff718  
    2828
    2929import org.cybergarage.net.*;
    30 import org.cybergarage.util.*;
    3130import org.cybergarage.http.*;
    3231import org.cybergarage.upnp.*;
  • router/java/src/org/cybergarage/upnp/ssdp/SSDPPacket.java

    re5eea47 r3fbff718  
    236236        ////////////////////////////////////////////////
    237237
     238    @Override
    238239        public String toString()
    239240        {
  • router/java/src/org/cybergarage/upnp/ssdp/SSDPResponse.java

    re5eea47 r3fbff718  
    113113        ////////////////////////////////////////////////
    114114       
     115    @Override
    115116        public String getHeader()
    116117        {
  • router/java/src/org/cybergarage/util/ListenerList.java

    re5eea47 r3fbff718  
    2222        private static final long serialVersionUID = 8039231561720446173L;
    2323
     24    @Override
    2425        public boolean add(Object obj)
    2526        {
  • router/java/src/org/cybergarage/util/Mutex.java

    re5eea47 r3fbff718  
    4141                        catch (Exception e) {
    4242                                Debug.warning(e);
    43                         };
     43                        }
    4444                }
    4545                syncLock = true;
  • router/java/src/org/cybergarage/xml/Node.java

    re5eea47 r3fbff718  
    7575        {
    7676                Node rootNode = null;
    77                 Node parentNode = getParentNode();
    78                 while (parentNode != null) {
    79                          rootNode = parentNode;
    80                          parentNode = rootNode.getParentNode();
     77                Node _parentNode = getParentNode();
     78                while (_parentNode != null) {
     79                         rootNode = _parentNode;
     80                         _parentNode = rootNode.getParentNode();
    8181                }
    8282                return rootNode;
     
    339339                String indentString = getIndentLevelString(indentLevel);
    340340
    341                 String name = getName();
    342                 String value = getValue();
     341                String _name = getName();
     342                String _value = getValue();
    343343
    344344                if (hasNodes() == false || hasChildNode == false) {
    345                         ps.print(indentString + "<" + name);
     345                        ps.print(indentString + "<" + _name);
    346346                        outputAttributes(ps);
    347347                        // Thnaks for Tho Beisch (11/09/04)
    348                         if (value == null || value.length() == 0) {
     348                        if (_value == null || _value.length() == 0) {
    349349                                // No value, so use short notation <node />
    350350                                ps.println(" />");
    351351                        } else {
    352                                 ps.println(">" + XML.escapeXMLChars(value) + "</" + name + ">");
     352                                ps.println(">" + XML.escapeXMLChars(_value) + "</" + _name + ">");
    353353                        }
    354354                       
     
    356356                }
    357357               
    358                 ps.print(indentString + "<" + name);
     358                ps.print(indentString + "<" + _name);
    359359                outputAttributes(ps);
    360360                ps.println(">");
     
    366366                }
    367367
    368                 ps.println(indentString +"</" + name + ">");
     368                ps.println(indentString +"</" + _name + ">");
    369369        }
    370370
  • router/java/src/org/xmlpull/v1/XmlPullParserException.java

    re5eea47 r3fbff718  
    6666
    6767    //NOTE: code that prints this and detail is difficult in J2ME
     68    @Override
    6869    public void printStackTrace() {
    6970        if (detail == null) {
Note: See TracChangeset for help on using the changeset viewer.