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.
This commit is contained in:
sponge
2009-08-11 21:58:56 +00:00
parent e5eea47b66
commit 3fbff71861
166 changed files with 2575 additions and 2417 deletions

View File

@ -7,7 +7,6 @@ package org.klomp.snark;
import java.util.Arrays;
import java.util.Properties;
import net.i2p.I2PAppContext;
import net.i2p.client.I2PSessionException;
import net.i2p.client.I2PClient;
import net.i2p.client.I2PSession;

View File

@ -137,6 +137,7 @@ public class BitField
return count >= size;
}
@Override
public String toString()
{
// Not very efficient

View File

@ -46,7 +46,7 @@ public class I2PSnarkUtil {
private Map _opts;
private I2PSocketManager _manager;
private boolean _configured;
private Set _shitlist;
private final Set _shitlist;
private int _maxUploaders;
private int _maxUpBW;
private int _maxConnections;

View File

@ -110,6 +110,7 @@ class Message
dos.write(data, off, len);
}
@Override
public String toString()
{
switch (type)

View File

@ -345,6 +345,7 @@ public class MetaInfo
return length;
}
@Override
public String toString()
{
return "MetaInfo[info_hash='" + hexencode(info_hash)

View File

@ -106,6 +106,7 @@ public class Peer implements Comparable
/**
* Returns the String representation of the peerID.
*/
@Override
public String toString()
{
if (peerID != null)
@ -125,6 +126,7 @@ public class Peer implements Comparable
/**
* The hash code of a Peer is the hash code of the peerID.
*/
@Override
public int hashCode()
{
return peerID.hashCode() ^ (2 << _id);
@ -134,6 +136,7 @@ public class Peer implements Comparable
* Two Peers are equal when they have the same PeerID.
* All other properties are ignored.
*/
@Override
public boolean equals(Object o)
{
if (o instanceof Peer)

View File

@ -41,7 +41,7 @@ class PeerConnectionOut implements Runnable
private boolean quit;
// Contains Messages.
private List sendQueue = new ArrayList();
private final List sendQueue = new ArrayList();
private static long __id = 0;
private long _id;

View File

@ -12,7 +12,7 @@ import java.util.Set;
* from it there too)
*/
public class PeerCoordinatorSet {
private Set _coordinators;
private final Set _coordinators;
public PeerCoordinatorSet() {
_coordinators = new HashSet();

View File

@ -107,6 +107,7 @@ public class PeerID implements Comparable
/**
* The hash code of a PeerID is the exclusive or of all id bytes.
*/
@Override
public int hashCode()
{
return hash;
@ -127,6 +128,7 @@ public class PeerID implements Comparable
/**
* Two PeerIDs are equal when they have the same id, address and port.
*/
@Override
public boolean equals(Object o)
{
if (o instanceof PeerID)
@ -171,6 +173,7 @@ public class PeerID implements Comparable
* and address is the base64 dest (was the base64 hash of the dest) which
* should match what the bytemonsoon tracker reports on its web pages.
*/
@Override
public String toString()
{
int nonZero = 0;

View File

@ -151,7 +151,7 @@ public interface PeerListener
*
* @param state the PeerState for the peer
*/
void savePeerPartial(PeerState state);
void savePeerPartial(PeerState state); /* FIXME Exporting non-public type through public API FIXME */
/**
* Called when a peer has connected and there may be a partially
@ -161,7 +161,7 @@ public interface PeerListener
*
* @return request (contains the partial data and valid length)
*/
Request getPeerPartial(BitField havePieces);
Request getPeerPartial(BitField havePieces); /* FIXME Exporting non-public type through public API FIXME */
/** Mark a peer's requested pieces unrequested when it is disconnected
* This prevents premature end game

View File

@ -20,13 +20,24 @@ public class Piece implements Comparable {
return this.peers.size() - ((Piece)o).peers.size();
}
@Override
public boolean equals(Object o) {
if (o == null) return false;
try {
return this.id == ((Piece)o).id;
} catch (ClassCastException cce) {
return false;
if (o instanceof Piece) {
if (o == null) return false;
try {
return this.id == ((Piece)o).id;
} catch (ClassCastException cce) {
return false;
}
}
return false;
}
@Override
public int hashCode() {
int hash = 5;
hash = 31 * hash + this.id;
return hash;
}
public int getId() { return this.id; }
@ -36,6 +47,7 @@ public class Piece implements Comparable {
public boolean isRequested() { return this.requested; }
public void setRequested(boolean requested) { this.requested = requested; }
@Override
public String toString() {
return String.valueOf(id);
}

View File

@ -51,11 +51,13 @@ class Request
throw new IndexOutOfBoundsException("Illegal Request " + toString());
}
@Override
public int hashCode()
{
return piece ^ off ^ len;
}
@Override
public boolean equals(Object o)
{
if (o instanceof Request)
@ -67,6 +69,7 @@ class Request
return false;
}
@Override
public String toString()
{
return "(" + piece + "," + off + "," + len + ")";

View File

@ -28,7 +28,6 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Random;
import java.util.StringTokenizer;

View File

@ -29,13 +29,13 @@ public class SnarkManager implements Snark.CompleteListener {
public static SnarkManager instance() { return _instance; }
/** map of (canonical) filename to Snark instance (unsynchronized) */
private Map _snarks;
private Object _addSnarkLock;
private File _configFile;
private final Map _snarks;
private final Object _addSnarkLock;
private /* FIXME final FIXME */ File _configFile;
private Properties _config;
private I2PAppContext _context;
private Log _log;
private List _messages;
private final List _messages;
private I2PSnarkUtil _util;
private PeerCoordinatorSet _peerCoordinatorSet;
private ConnectionAcceptor _connectionAcceptor;
@ -747,6 +747,7 @@ public class SnarkManager implements Snark.CompleteListener {
}
public class SnarkManagerShutdown extends I2PAppThread {
@Override
public void run() {
Set names = listTorrentFiles();
for (Iterator iter = names.iterator(); iter.hasNext(); ) {

View File

@ -36,6 +36,7 @@ public class SnarkShutdown extends I2PAppThread
private final ShutdownListener listener;
/* FIXME Exporting non-public type through public API FIXME */
public SnarkShutdown(Storage storage,
PeerCoordinator coordinator,
ConnectionAcceptor acceptor,
@ -49,6 +50,7 @@ public class SnarkShutdown extends I2PAppThread
this.listener = listener;
}
@Override
public void run()
{
//Snark.debug("Shutting down...", Snark.NOTICE);

View File

@ -46,7 +46,7 @@ public class Storage
private final StorageListener listener;
private I2PSnarkUtil _util;
private BitField bitfield; // BitField to represent the pieces
private /* FIXME final FIXME */ BitField bitfield; // BitField to represent the pieces
private int needed; // Number of pieces needed
private boolean _probablyComplete; // use this to decide whether to open files RO

View File

@ -81,6 +81,7 @@ public class TrackerClient extends I2PAppThread
started = false;
}
@Override
public void start() {
if (stop) throw new RuntimeException("Dont rerun me, create a copy");
super.start();
@ -109,6 +110,7 @@ public class TrackerClient extends I2PAppThread
return !stop && _util.connected();
}
@Override
public void run()
{
String infoHash = urlencode(meta.getInfoHash());
@ -162,7 +164,7 @@ public class TrackerClient extends I2PAppThread
try
{
if (!verifyConnected()) return;
boolean started = false;
boolean runStarted = false;
boolean firstTime = true;
int consecutiveFails = 0;
Random r = new Random();
@ -178,7 +180,7 @@ public class TrackerClient extends I2PAppThread
if (firstTime) {
delay = r.nextInt(30*1000);
firstTime = false;
} else if (completed && started)
} else if (completed && runStarted)
delay = 3*SLEEP*60*1000 + random;
else if (coordinator.trackerProblems != null && ++consecutiveFails < MAX_CONSEC_FAILS)
delay = INITIAL_SLEEP;
@ -221,7 +223,7 @@ public class TrackerClient extends I2PAppThread
Tracker tr = (Tracker)iter.next();
if ((!stop) && (!tr.stop) &&
(completed || coordinator.needPeers()) &&
(event == COMPLETED_EVENT || System.currentTimeMillis() > tr.lastRequestTime + tr.interval))
(event.equals(COMPLETED_EVENT) || System.currentTimeMillis() > tr.lastRequestTime + tr.interval))
{
try
{
@ -237,7 +239,7 @@ public class TrackerClient extends I2PAppThread
tr.consecutiveFails = 0;
if (tr.isPrimary)
consecutiveFails = 0;
started = true;
runStarted = true;
tr.started = true;
Set peers = info.getPeers();
@ -296,7 +298,7 @@ public class TrackerClient extends I2PAppThread
// we could try and total the unique peers but that's too hard for now
coordinator.trackerSeenPeers = maxSeenPeers;
if (!started)
if (!runStarted)
_util.debug(" Retrying in one minute...", Snark.DEBUG);
} // *** end of while loop
} // try
@ -338,7 +340,7 @@ public class TrackerClient extends I2PAppThread
+ "&uploaded=" + uploaded
+ "&downloaded=" + downloaded
+ "&left=" + left
+ ((event != NO_EVENT) ? ("&event=" + event) : "");
+ ((! event.equals(NO_EVENT)) ? ("&event=" + event) : "");
_util.debug("Sending TrackerClient request: " + s, Snark.INFO);
tr.lastRequestTime = System.currentTimeMillis();

View File

@ -125,6 +125,7 @@ public class TrackerInfo
return interval;
}
@Override
public String toString()
{
if (failure_reason != null)

View File

@ -172,6 +172,7 @@ public class BEValue
/** return the untyped value */
public Object getValue() { return value; }
@Override
public String toString()
{
String valueString;

View File

@ -27,7 +27,6 @@ import net.i2p.util.FileUtil;
import net.i2p.util.I2PAppThread;
import net.i2p.util.Log;
import org.klomp.snark.I2PSnarkUtil;
import org.klomp.snark.MetaInfo;
import org.klomp.snark.Peer;
import org.klomp.snark.Snark;
@ -46,6 +45,7 @@ public class I2PSnarkServlet extends HttpServlet {
public static final String PROP_CONFIG_FILE = "i2psnark.configFile";
@Override
public void init(ServletConfig cfg) throws ServletException {
super.init(cfg);
_context = I2PAppContext.getGlobalContext();
@ -59,6 +59,7 @@ public class I2PSnarkServlet extends HttpServlet {
_manager.start();
}
@Override
public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("UTF-8");
resp.setCharacterEncoding("UTF-8");

View File

@ -14,7 +14,7 @@ import net.i2p.util.Log;
*/
class BufferLogger implements Logging {
private final static Log _log = new Log(BufferLogger.class);
private ByteArrayOutputStream _baos; // should be final and use a factory. LINT
private ByteArrayOutputStream _baos; // FIXME should be final and use a factory. FIXME
private boolean _ignore;
/**

View File

@ -66,7 +66,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
// private Object conLock = new Object();
/** List of Socket for those accept()ed but not yet started up */
private List _waitingSockets = new ArrayList(); // should be final and use a factory. LINT
private List _waitingSockets = new ArrayList(); // FIXME should be final and use a factory. FIXME
/** How many connections will we allow to be in the process of being built at once? */
private int _numConnectionBuilders;
/** How long will we allow sockets to sit in the _waitingSockets map before killing them? */

View File

@ -153,6 +153,7 @@ public class I2PTunnelConnectClient extends I2PTunnelClientBase implements Runna
* create the default options (using the default timeout, etc)
*
*/
@Override
protected I2PSocketOptions getDefaultOptions() {
Properties defaultOpts = getTunnel().getClientOptions();
if (!defaultOpts.contains(I2PSocketOptions.PROP_READ_TIMEOUT))
@ -259,8 +260,8 @@ public class I2PTunnelConnectClient extends I2PTunnelClientBase implements Runna
return;
}
Destination dest = I2PTunnel.destFromName(destination);
if (dest == null) {
Destination clientDest = I2PTunnel.destFromName(destination);
if (clientDest == null) {
String str;
byte[] header;
if (usingWWWProxy)
@ -276,7 +277,7 @@ public class I2PTunnelConnectClient extends I2PTunnelClientBase implements Runna
return;
}
I2PSocket i2ps = createI2PSocket(dest, getDefaultOptions());
I2PSocket i2ps = createI2PSocket(clientDest, getDefaultOptions());
byte[] data = null;
byte[] response = null;
if (usingWWWProxy)

View File

@ -191,6 +191,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
* create the default options (using the default timeout, etc)
* unused?
*/
@Override
protected I2PSocketOptions getDefaultOptions() {
Properties defaultOpts = getTunnel().getClientOptions();
if (!defaultOpts.contains(I2PSocketOptions.PROP_READ_TIMEOUT))
@ -207,6 +208,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
* create the default options (using the default timeout, etc)
*
*/
@Override
protected I2PSocketOptions getDefaultOptions(Properties overrides) {
Properties defaultOpts = getTunnel().getClientOptions();
defaultOpts.putAll(overrides);
@ -561,8 +563,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
return;
}
Destination dest = I2PTunnel.destFromName(destination);
if (dest == null) {
Destination clientDest = I2PTunnel.destFromName(destination);
if (clientDest == null) {
//l.log("Could not resolve " + destination + ".");
if (_log.shouldLog(Log.WARN))
_log.warn("Unable to resolve " + destination + " (proxy? " + usingWWWProxy + ", request: " + targetRequest);
@ -594,7 +596,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable
// 1 == disconnect. see ConnectionOptions in the new streaming lib, which i
// dont want to hard link to here
//opts.setProperty("i2p.streaming.inactivityTimeoutAction", ""+1);
I2PSocket i2ps = createI2PSocket(dest, getDefaultOptions(opts));
I2PSocket i2ps = createI2PSocket(clientDest, getDefaultOptions(opts));
byte[] data = newRequest.toString().getBytes("ISO-8859-1");
Runnable onTimeout = new OnTimeout(s, s.getOutputStream(), targetRequest, usingWWWProxy, currentProxy, requestId);
I2PTunnelRunner runner = new I2PTunnelHTTPClientRunner(s, i2ps, sockLock, data, mySockets, onTimeout);

View File

@ -77,10 +77,10 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
protected void clientConnectionRun(Socket s) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("got a connection.");
Destination dest = pickDestination();
Destination clientDest = pickDestination();
I2PSocket i2ps = null;
try {
i2ps = createI2PSocket(dest);
i2ps = createI2PSocket(clientDest);
i2ps.setReadTimeout(readTimeout);
StringBuilder expectedPong = new StringBuilder();
Thread in = new I2PThread(new IrcInboundFilter(s,i2ps, expectedPong), "IRC Client " + __clientId + " in");

View File

@ -54,6 +54,6 @@ public class Pinger implements Source, Runnable {
protected Sink sink;
protected Thread thread;
protected Object waitlock; // should be final and use a factory. LINT
protected Object waitlock; // FIXME should be final and use a factory. FIXME
protected boolean running;
}

View File

@ -69,5 +69,5 @@ public class I2PSink implements Sink {
protected boolean raw;
protected I2PSession sess;
protected Destination dest;
protected I2PDatagramMaker maker; // should be final and use a factory. LINT
protected I2PDatagramMaker maker; // FIXME should be final and use a factory. FIXME
}

View File

@ -67,5 +67,5 @@ public class I2PSinkAnywhere implements Sink {
protected boolean raw;
protected I2PSession sess;
protected Destination dest;
protected I2PDatagramMaker maker; // should be final and use a factory. LINT
protected I2PDatagramMaker maker; // FIXME should be final and use a factory. FIXME
}

View File

@ -60,7 +60,7 @@ import net.i2p.util.Log;
private ServerSocket ss;
private Object startLock = new Object();
private final Object startLock = new Object();
private boolean startRunning = false;
private byte[] pubkey;

View File

@ -29,7 +29,7 @@ class I2PSocketImpl implements I2PSocket {
private Destination remote;
private String localID;
private String remoteID;
private Object remoteIDWaiter = new Object();
private final Object remoteIDWaiter = new Object();
private I2PInputStream in;
private I2POutputStream out;
private I2PSocket.SocketErrorListener _socketErrorListener;
@ -42,7 +42,7 @@ class I2PSocketImpl implements I2PSocket {
private long _closedOn;
private long _remoteIdSetTime;
private I2PSocketOptions _options;
private Object flagLock = new Object();
private final Object flagLock = new Object();
/**
* Whether the I2P socket has already been closed.
@ -306,7 +306,7 @@ class I2PSocketImpl implements I2PSocket {
//--------------------------------------------------
private class I2PInputStream extends InputStream {
private String streamName;
private ByteCollector bc = new ByteCollector();
private final ByteCollector bc = new ByteCollector();
private boolean inStreamClosed = false;
private long readTimeout = -1;

View File

@ -13,7 +13,6 @@ import net.i2p.client.I2PClient;
import net.i2p.client.I2PClientFactory;
import net.i2p.client.I2PSession;
import net.i2p.client.I2PSessionException;
import net.i2p.data.Destination;
import net.i2p.util.Log;
/**

View File

@ -40,7 +40,7 @@ import net.i2p.util.Log;
class I2PSocketManagerImpl implements I2PSocketManager, I2PSessionListener {
private I2PAppContext _context;
private Log _log;
private /* final */ I2PSession _session;
private /* FIXME final FIXME */ I2PSession _session;
private I2PServerSocketImpl _serverSocket = null;
private final Object lock = new Object(); // for locking socket lists
private HashMap<String,I2PSocket> _outSockets;

View File

@ -62,7 +62,7 @@ public class ConnectionOptions extends I2PSocketOptionsImpl {
private static final boolean DEFAULT_ANSWER_PINGS = true;
// Syncronization fix, but doing it this way causes NPE...
// private final int _trend[] = new int[TREND_COUNT];
// FIXME private final int _trend[] = new int[TREND_COUNT]; FIXME
private int _trend[];
/**

View File

@ -212,6 +212,8 @@ public class HashCash implements Comparable<HashCash> {
/**
* Two objects are considered equal if they are both of type HashCash and have an identical string representation
*/
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object obj) {
if(obj instanceof HashCash)
return toString().equals(obj.toString());
@ -222,6 +224,7 @@ public class HashCash implements Comparable<HashCash> {
/**
* Returns the canonical string representation of the HashCash
*/
@Override
public String toString() {
return myToken;
}

View File

@ -167,6 +167,7 @@ public class CPUID {
public boolean IsC3Compatible() { return false; }
}
protected static class VIAC3Impl extends CPUIDCPUInfo implements CPUInfo {
@Override
public boolean IsC3Compatible() { return true; }
public String getCPUModelString() { return "VIA C3"; }
}

View File

@ -164,6 +164,7 @@ public abstract class BaseHashStandalone implements IMessageDigestStandalone {
// methods to be implemented by concrete subclasses ------------------------
@Override
public abstract Object clone();
public abstract boolean selfTest();

View File

@ -47,6 +47,7 @@ public class AsyncFortunaStandalone extends FortunaStandalone implements Runnabl
}
/** the seed is only propogated once the prng is started with startup() */
@Override
public void seed(byte val[]) {
Map props = new HashMap(1);
props.put(SEED, (Object)val);
@ -54,6 +55,7 @@ public class AsyncFortunaStandalone extends FortunaStandalone implements Runnabl
//fillBlock();
}
@Override
protected void allocBuffer() {}
/**
@ -133,6 +135,7 @@ public class AsyncFortunaStandalone extends FortunaStandalone implements Runnabl
}
}
@Override
public void fillBlock()
{
rotateBuffer();

View File

@ -172,6 +172,7 @@ public abstract class BasePRNGStandalone implements IRandomStandalone {
// abstract methods to implement by subclasses -----------------------------
@Override
public Object clone() throws CloneNotSupportedException
{
return super.clone();

View File

@ -169,6 +169,7 @@ public class FortunaStandalone extends BasePRNGStandalone implements Serializabl
System.out.println("Refilling " + (++refillCount) + " after " + diff + " for the PRNG took " + refillTime);
}
@Override
public void addRandomByte(byte b)
{
pools[pool].update(b);
@ -177,6 +178,7 @@ public class FortunaStandalone extends BasePRNGStandalone implements Serializabl
pool = (pool + 1) % NUM_POOLS;
}
@Override
public void addRandomBytes(byte[] buf, int offset, int length)
{
pools[pool].update(buf, offset, length);
@ -244,6 +246,7 @@ public class FortunaStandalone extends BasePRNGStandalone implements Serializabl
cryptixKeyBuf = CryptixAESKeyCache.createNew();
}
@Override
public final byte nextByte()
{
byte[] b = new byte[1];
@ -251,6 +254,7 @@ public class FortunaStandalone extends BasePRNGStandalone implements Serializabl
return b[0];
}
@Override
public final void nextBytes(byte[] out, int offset, int length)
{
if (!seeded)
@ -280,11 +284,13 @@ public class FortunaStandalone extends BasePRNGStandalone implements Serializabl
ndx = 0;
}
@Override
public final void addRandomByte(byte b)
{
addRandomBytes(new byte[] { b });
}
@Override
public final void addRandomBytes(byte[] seed, int offset, int length)
{
hash.update(key, 0, key.length);

View File

@ -73,7 +73,7 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
/** reader that always searches for messages */
protected I2CPMessageReader _reader;
/** where we pipe our messages */
protected OutputStream _out;
protected /* FIXME final FIXME */OutputStream _out;
/** who we send events to */
protected I2PSessionListener _sessionListener;

View File

@ -33,7 +33,7 @@ import net.i2p.util.Log;
class I2PSessionImpl2 extends I2PSessionImpl {
/** set of MessageState objects, representing all of the messages in the process of being sent */
private Set _sendingStates;
private /* FIXME final FIXME */ Set _sendingStates;
/** max # seconds to wait for confirmation of the message send */
private final static long SEND_TIMEOUT = 60 * 1000; // 60 seconds to send
/** should we gzip each payload prior to sending it? */

View File

@ -7,14 +7,11 @@ package net.i2p.client;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Properties;
import java.util.Set;
import net.i2p.I2PAppContext;
import net.i2p.data.DataHelper;
import net.i2p.data.Destination;
import net.i2p.data.Hash;
import net.i2p.data.i2cp.BandwidthLimitsMessage;
@ -23,7 +20,6 @@ import net.i2p.data.i2cp.DestReplyMessage;
import net.i2p.data.i2cp.GetBandwidthLimitsMessage;
import net.i2p.data.i2cp.I2CPMessageReader;
import net.i2p.util.I2PThread;
import net.i2p.util.Log;
/**
* Create a new session for doing naming and bandwidth queries only. Do not create a Destination.
@ -35,10 +31,10 @@ import net.i2p.util.Log;
*/
class I2PSimpleSession extends I2PSessionImpl2 {
private boolean _destReceived;
private Object _destReceivedLock;
private /* FIXME final FIXME */ Object _destReceivedLock;
private Destination _destination;
private boolean _bwReceived;
private Object _bwReceivedLock;
private /* FIXME final FIXME */ Object _bwReceivedLock;
private int[] _bwLimits;
/**
@ -65,6 +61,7 @@ class I2PSimpleSession extends I2PSessionImpl2 {
* @throws I2PSessionException if there is a configuration error or the router is
* not reachable
*/
@Override
public void connect() throws I2PSessionException {
_closed = false;
_availabilityNotifier.stopNotifying();
@ -109,6 +106,7 @@ class I2PSimpleSession extends I2PSessionImpl2 {
}
}
@Override
public Destination lookupDest(Hash h) throws I2PSessionException {
if (_closed)
return null;
@ -125,6 +123,7 @@ class I2PSimpleSession extends I2PSessionImpl2 {
return _destination;
}
@Override
public int[] bandwidthLimits() throws I2PSessionException {
if (_closed)
return null;

View File

@ -21,7 +21,7 @@ class MessageState {
private long _nonce;
private String _prefix;
private MessageId _id;
private Set _receivedStatus;
private final Set _receivedStatus;
private SessionKey _key;
private SessionKey _newKey;
private Set _tags;

View File

@ -34,7 +34,7 @@ import net.i2p.util.Log;
* @author jrandom
*/
class RequestLeaseSetMessageHandler extends HandlerImpl {
private Map _existingLeaseSets;
private final Map _existingLeaseSets;
public RequestLeaseSetMessageHandler(I2PAppContext context) {
super(context, RequestLeaseSetMessage.MESSAGE_TYPE);

View File

@ -36,6 +36,7 @@ public class SessionIdleTimer implements SimpleTimer.TimedEvent {
/**
* reduce, shutdown, or both must be true
*/
/* FIXME Exporting non-public type through public API FIXME */
public SessionIdleTimer(I2PAppContext context, I2PSessionImpl session, boolean reduce, boolean shutdown) {
_context = context;
_session = session;

View File

@ -12,10 +12,8 @@ import net.i2p.client.I2PClient;
import net.i2p.client.I2PSession;
import net.i2p.client.I2PSimpleClient;
import net.i2p.data.Base32;
import net.i2p.data.Base64;
import net.i2p.data.Destination;
import net.i2p.data.Hash;
import net.i2p.data.LeaseSet;
/**
* Connect via I2CP and ask the router to look up

View File

@ -26,7 +26,7 @@ public abstract class NamingService {
private final static Log _log = new Log(NamingService.class);
protected I2PAppContext _context;
private HashMap _cache;
private /* FIXME final FIXME */ HashMap _cache;
/** what classname should be used as the naming service impl? */
public static final String PROP_IMPL = "i2p.naming.impl";

View File

@ -23,7 +23,7 @@ import java.util.Set;
*/
public class PetNameDB {
/** name (String) to PetName mapping */
private Map _names;
private final Map _names;
private String _path;
public PetNameDB() {

View File

@ -11,7 +11,7 @@ import java.util.List;
*
*/
public final class CryptixAESKeyCache {
private List _availableKeys;
private final List _availableKeys;
private static final int KEYSIZE = 32; // 256bit AES
private static final int BLOCKSIZE = 16;

View File

@ -53,6 +53,7 @@ public class DHSessionKeyBuilder {
private static int MIN_NUM_BUILDERS = -1;
private static int MAX_NUM_BUILDERS = -1;
private static int CALC_DELAY = -1;
/* FIXME this should be final if you syncronize FIXME */
private static volatile List _builders = new ArrayList(50);
private static Thread _precalcThread = null;
private BigInteger _myPrivateValue;

View File

@ -22,9 +22,9 @@ import org.bouncycastle.crypto.macs.I2PHMac;
public class HMACGenerator {
private I2PAppContext _context;
/** set of available HMAC instances for calculate */
protected List _available;
protected final List _available;
/** set of available byte[] buffers for verify */
private List _availableTmp;
private final List _availableTmp;
public HMACGenerator(I2PAppContext context) {
_context = context;

View File

@ -16,7 +16,7 @@ import net.i2p.data.Hash;
*/
public final class SHA256Generator {
private List _digests;
private List _digestsGnu;
private final List _digestsGnu;
public SHA256Generator(I2PAppContext context) {
_digests = new ArrayList(32);
_digestsGnu = new ArrayList(32);

View File

@ -36,9 +36,9 @@ import net.i2p.util.SimpleTimer;
public class TransientSessionKeyManager extends SessionKeyManager {
private Log _log;
/** Map allowing us to go from the targeted PublicKey to the OutboundSession used */
private Map<PublicKey, OutboundSession> _outboundSessions;
private final Map<PublicKey, OutboundSession> _outboundSessions;
/** Map allowing us to go from a SessionTag to the containing TagSet */
private Map<SessionTag, TagSet> _inboundTagSets;
private final Map<SessionTag, TagSet> _inboundTagSets;
protected I2PAppContext _context;
private volatile boolean _alive;
@ -81,6 +81,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
}
private TransientSessionKeyManager() { this(null); }
@Override
public void shutdown() {
_alive = false;
synchronized (_inboundTagSets) {
@ -105,6 +106,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
/** TagSet */
/* FIXME Exporting non-public type through public API */
protected Set<TagSet> getInboundTagSets() {
synchronized (_inboundTagSets) {
return new HashSet(_inboundTagSets.values());
@ -112,12 +114,14 @@ public class TransientSessionKeyManager extends SessionKeyManager {
}
/** OutboundSession */
/* FIXME Exporting non-public type through public API */
protected Set<OutboundSession> getOutboundSessions() {
synchronized (_outboundSessions) {
return new HashSet(_outboundSessions.values());
}
}
/* FIXME Exporting non-public type through public API */
protected void setData(Set<TagSet> inboundTagSets, Set<OutboundSession> outboundSessions) {
if (_log.shouldLog(Log.INFO))
_log.info("Loading " + inboundTagSets.size() + " inbound tag sets, and "
@ -557,7 +561,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
private SessionKey _currentKey;
private long _established;
private long _lastUsed;
private List<TagSet> _tagSets;
private /* FIXME final FIXME */ List<TagSet> _tagSets;
public OutboundSession(PublicKey target) {
this(target, null, _context.clock().now(), _context.clock().now(), new ArrayList());

View File

@ -278,7 +278,7 @@ D8usM7Dxp5yrDrCYZ5AIijc=
private static final void showVersionCLI(String signedFile) {
String versionString = new TrustedUpdate().getVersionString(new File(signedFile));
if (versionString == "")
if (versionString.equals(""))
System.out.println("No version string found in file '" + signedFile + "'");
else
System.out.println("Version: " + versionString);

View File

@ -43,6 +43,7 @@ class YKGenerator {
private static int MIN_NUM_BUILDERS = -1;
private static int MAX_NUM_BUILDERS = -1;
private static int CALC_DELAY = -1;
/* FIXME final type if you are to syncronize FIXME */
private static volatile List _values = new ArrayList(50); // list of BigInteger[] values (y and k)
private static Thread _precalcThread = null;

View File

@ -31,7 +31,7 @@ public class Hash extends DataStructureImpl {
private byte[] _data;
private volatile String _stringified;
private volatile String _base64ed;
private Map _xorCache;
private /* FIXME final FIXME */ Map _xorCache;
public final static int HASH_LENGTH = 32;
public final static Hash FAKE_HASH = new Hash(new byte[HASH_LENGTH]);

View File

@ -262,6 +262,7 @@ public class PrivateKeyFile {
out.close();
}
@Override
public String toString() {
StringBuilder s = new StringBuilder(128);
s.append("Dest: ");

View File

@ -36,9 +36,9 @@ public class RouterInfo extends DataStructureImpl {
private final static Log _log = new Log(RouterInfo.class);
private RouterIdentity _identity;
private volatile long _published;
private Set _addresses;
private Set _peers;
private Properties _options;
private final Set _addresses;
private final Set _peers;
private /* FIXME final FIXME */ Properties _options;
private volatile Signature _signature;
private volatile Hash _currentRoutingKey;
private volatile byte _routingKeyGenMod[];

View File

@ -80,6 +80,7 @@ public class BandwidthLimitsMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof BandwidthLimitsMessage)) {

View File

@ -113,6 +113,7 @@ public class CreateLeaseSetMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof CreateLeaseSetMessage)) {

View File

@ -72,6 +72,7 @@ public class CreateSessionMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof CreateSessionMessage)) {

View File

@ -58,6 +58,8 @@ public class DestLookupMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof DestLookupMessage)) {
DestLookupMessage msg = (DestLookupMessage) object;
@ -66,6 +68,7 @@ public class DestLookupMessage extends I2CPMessageImpl {
return false;
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append("[DestLookupMessage: ");

View File

@ -60,6 +60,8 @@ public class DestReplyMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof DestReplyMessage)) {
DestReplyMessage msg = (DestReplyMessage) object;
@ -68,6 +70,7 @@ public class DestReplyMessage extends I2CPMessageImpl {
return false;
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append("[DestReplyMessage: ");

View File

@ -78,6 +78,13 @@ public class DestroySessionMessage extends I2CPMessageImpl {
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 11 * hash + (this._sessionId != null ? this._sessionId.hashCode() : 0);
return hash;
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder();

View File

@ -64,6 +64,7 @@ public class DisconnectMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof DisconnectMessage)) {

View File

@ -38,6 +38,7 @@ public class GetBandwidthLimitsMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof GetBandwidthLimitsMessage)) {

View File

@ -41,6 +41,7 @@ public class GetDateMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof GetDateMessage)) {

View File

@ -109,6 +109,7 @@ public class MessagePayloadMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof MessagePayloadMessage)) {

View File

@ -154,6 +154,7 @@ public class MessageStatusMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof MessageStatusMessage)) {

View File

@ -89,6 +89,7 @@ public class ReceiveMessageBeginMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof ReceiveMessageBeginMessage)) {

View File

@ -73,6 +73,7 @@ public class ReceiveMessageEndMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof ReceiveMessageEndMessage)) {

View File

@ -80,6 +80,7 @@ public class ReconfigureSessionMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof ReconfigureSessionMessage)) {

View File

@ -110,6 +110,7 @@ public class ReportAbuseMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof ReportAbuseMessage)) {

View File

@ -126,6 +126,7 @@ public class RequestLeaseSetMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof RequestLeaseSetMessage)) {

View File

@ -27,6 +27,7 @@ import net.i2p.util.Log;
*/
public class SendMessageExpiresMessage extends SendMessageMessage {
private final static Log _log = new Log(SendMessageExpiresMessage.class);
/* FIXME hides another field FIXME */
public final static int MESSAGE_TYPE = 36;
private SessionId _sessionId;
private Destination _destination;
@ -87,10 +88,12 @@ public class SendMessageExpiresMessage extends SendMessageMessage {
}
}
@Override
public int getType() {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof SendMessageExpiresMessage)) {

View File

@ -135,6 +135,7 @@ public class SendMessageMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof SendMessageMessage)) {

View File

@ -203,6 +203,7 @@ public class SessionConfig extends DataStructureImpl {
_signature.writeBytes(out);
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof SessionConfig)) {

View File

@ -84,6 +84,7 @@ public class SessionStatusMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode method FIXME */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof SessionStatusMessage)) {

View File

@ -67,6 +67,7 @@ public class SetDateMessage extends I2CPMessageImpl {
return MESSAGE_TYPE;
}
/* FIXME missing hashCode() method */
@Override
public boolean equals(Object object) {
if ((object != null) && (object instanceof SetDateMessage)) {

View File

@ -20,12 +20,12 @@ import net.i2p.util.Log;
public class BufferedStatLog implements StatLog {
private I2PAppContext _context;
private Log _log;
private StatEvent _events[];
private final StatEvent _events[];
private int _eventNext;
private int _lastWrite;
/** flush stat events to disk after this many events (or 30s)*/
private int _flushFrequency;
private List _statFilters;
private final List _statFilters;
private String _lastFilters;
private BufferedWriter _out;
private String _outFile;
@ -125,7 +125,7 @@ public class BufferedStatLog implements StatLog {
}
private class StatLogWriter implements Runnable {
private SimpleDateFormat _fmt = new SimpleDateFormat("yyyyMMdd HH:mm:ss.SSS");
private final SimpleDateFormat _fmt = new SimpleDateFormat("yyyyMMdd HH:mm:ss.SSS");
public void run() {
int writeStart = -1;
int writeEnd = -1;

View File

@ -11,7 +11,7 @@ public class Frequency {
private long _lastEvent;
private long _start = now();
private long _count = 0;
private Object _lock = this; // new Object(); // in case we want to do fancy sync later
private final Object _lock = this; // new Object(); // in case we want to do fancy sync later
public Frequency(long period) {
setPeriod(period);

View File

@ -58,6 +58,8 @@ public class FrequencyStat {
return null;
}
/* FIXME missing equals() method FIXME */
@Override
public int hashCode() {
return _statName.hashCode();
}

View File

@ -33,7 +33,7 @@ public class Rate {
private long _period;
/** locked during coalesce and addData */
private Object _lock = new Object();
private final Object _lock = new Object();
/** in the current (partial) period, what is the total value acrued through all events? */
public double getCurrentTotalValue() {
@ -452,6 +452,26 @@ public class Rate {
&& _lifetimeTotalEventTime == r.getLifetimeTotalEventTime();
}
@Override
public int hashCode() {
int hash = 5;
hash = 67 * hash + (int)(Double.doubleToLongBits(this._currentTotalValue) ^ (Double.doubleToLongBits(this._currentTotalValue) >>> 32));
hash = 67 * hash + (int)(this._currentEventCount ^ (this._currentEventCount >>> 32));
hash = 67 * hash + (int)(this._currentTotalEventTime ^ (this._currentTotalEventTime >>> 32));
hash = 67 * hash + (int)(Double.doubleToLongBits(this._lastTotalValue) ^ (Double.doubleToLongBits(this._lastTotalValue) >>> 32));
hash = 67 * hash + (int)(this._lastEventCount ^ (this._lastEventCount >>> 32));
hash = 67 * hash + (int)(this._lastTotalEventTime ^ (this._lastTotalEventTime >>> 32));
hash = 67 * hash + (int)(Double.doubleToLongBits(this._extremeTotalValue) ^ (Double.doubleToLongBits(this._extremeTotalValue) >>> 32));
hash = 67 * hash + (int)(this._extremeEventCount ^ (this._extremeEventCount >>> 32));
hash = 67 * hash + (int)(this._extremeTotalEventTime ^ (this._extremeTotalEventTime >>> 32));
hash = 67 * hash + (int)(Double.doubleToLongBits(this._lifetimeTotalValue) ^ (Double.doubleToLongBits(this._lifetimeTotalValue) >>> 32));
hash = 67 * hash + (int)(this._lifetimeEventCount ^ (this._lifetimeEventCount >>> 32));
hash = 67 * hash + (int)(this._lifetimeTotalEventTime ^ (this._lifetimeTotalEventTime >>> 32));
hash = 67 * hash + (int)(this._creationDate ^ (this._creationDate >>> 32));
hash = 67 * hash + (int)(this._period ^ (this._period >>> 32));
return hash;
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder(2048);

View File

@ -25,9 +25,9 @@ public class StatManager {
private I2PAppContext _context;
/** stat name to FrequencyStat */
private Map _frequencyStats;
private final Map _frequencyStats;
/** stat name to RateStat */
private Map _rateStats;
private final Map _rateStats;
private StatLog _statLog;
public static final String PROP_STAT_FILTER = "stat.logFilters";

View File

@ -18,9 +18,9 @@ import net.i2p.util.Log;
public class Timestamper implements Runnable {
private I2PAppContext _context;
private Log _log;
private List<String> _servers;
private final List<String> _servers;
private List<String> _priorityServers;
private List<UpdateListener> _listeners;
private final List<UpdateListener> _listeners;
private int _queryFrequency;
private int _concurringServers;
private volatile boolean _disabled;
@ -52,6 +52,9 @@ public class Timestamper implements Runnable {
this(ctx, lsnr, true);
}
public Timestamper(I2PAppContext ctx, UpdateListener lsnr, boolean daemon) {
// moved here to prevent problems with synchronized statements.
_servers = new ArrayList(3);
_listeners = new ArrayList(1);
// Don't bother starting a thread if we are disabled.
// This means we no longer check every 5 minutes to see if we got enabled,
// so the property must be set at startup.
@ -65,8 +68,6 @@ public class Timestamper implements Runnable {
_daemon = daemon;
_initialized = false;
_wellSynced = false;
_servers = new ArrayList(3);
_listeners = new ArrayList(1);
if (lsnr != null)
_listeners.add(lsnr);
updateConfig();

View File

@ -15,7 +15,7 @@ import net.i2p.data.ByteArray;
*
*/
public final class ByteCache {
private static Map _caches = new HashMap(16);
private final static Map _caches = new HashMap(16);
/**
* Get a cache responsible for objects of the given size
*
@ -36,7 +36,7 @@ public final class ByteCache {
}
private Log _log;
/** list of available and available entries */
private List _available;
private final List _available;
private int _maxCached;
private int _entrySize;
private long _lastOverflow;

View File

@ -44,7 +44,7 @@ public class Clock implements Timestamper.UpdateListener {
protected volatile long _offset;
protected boolean _alreadyChanged;
private Set _listeners;
private final Set _listeners;
/** if the clock is skewed by 3+ days, fuck 'em */
public final static long MAX_OFFSET = 3 * 24 * 60 * 60 * 1000;

View File

@ -23,22 +23,27 @@ public class ConcurrentHashSet<E> extends AbstractSet<E> implements Set<E> {
_map = new ConcurrentHashMap(capacity);
}
@Override
public boolean add(E o) {
return _map.put(o, DUMMY) == null;
}
@Override
public void clear() {
_map.clear();
}
@Override
public boolean contains(Object o) {
return _map.containsKey(o);
}
@Override
public boolean isEmpty() {
return _map.isEmpty();
}
@Override
public boolean remove(Object o) {
return _map.remove(o) != null;
}
@ -51,6 +56,7 @@ public class ConcurrentHashSet<E> extends AbstractSet<E> implements Set<E> {
return _map.keySet().iterator();
}
@Override
public boolean addAll(Collection<? extends E> c) {
boolean rv = false;
for (E e : c)

View File

@ -43,7 +43,7 @@ public class EepGet {
protected String _actualURL;
private String _postData;
private boolean _allowCaching;
protected List _listeners;
protected final List _listeners;
private boolean _keepFetching;
private Socket _proxy;
@ -256,8 +256,8 @@ public class EepGet {
private long _discarded;
private long _lastComplete;
private boolean _firstTime;
private DecimalFormat _pct = new DecimalFormat("00.0%");
private DecimalFormat _kbps = new DecimalFormat("###,000.00");
private final DecimalFormat _pct = new DecimalFormat("00.0%");
private final DecimalFormat _kbps = new DecimalFormat("###,000.00");
public CLIStatusListener() {
this(1024, 40);
}

View File

@ -35,8 +35,8 @@ public class EventDispatcherImpl implements EventDispatcher {
private final static Log _log = new Log(EventDispatcherImpl.class);
private boolean _ignore = false;
private HashMap _events = new HashMap(4);
private ArrayList _attached = new ArrayList();
private /* FIXME final FIXME */ HashMap _events = new HashMap(4);
private final ArrayList _attached = new ArrayList();
public EventDispatcher getEventDispatcher() {
return this;

View File

@ -7,7 +7,7 @@ import net.i2p.I2PAppContext;
class Executor implements Runnable {
private I2PAppContext _context;
private Log _log;
private List _readyEvents;
private final List _readyEvents;
private SimpleStore runn;
public Executor(I2PAppContext ctx, Log log, List events, SimpleStore x) {

View File

@ -43,6 +43,7 @@ public class I2PAppThread extends I2PThread {
super(r, name, isDaemon);
}
@Override
protected void fireOOM(OutOfMemoryError oom) {
for (Iterator iter = _threadListeners.iterator(); iter.hasNext(); ) {
OOMEventListener listener = (OOMEventListener)iter.next();

View File

@ -11,8 +11,8 @@ import net.i2p.I2PAppContext;
*/
public class LogConsoleBuffer {
private I2PAppContext _context;
private List _buffer;
private List _critBuffer;
private final List _buffer;
private final List _critBuffer;
public LogConsoleBuffer(I2PAppContext context) {
_context = context;

View File

@ -70,11 +70,11 @@ public class LogManager {
/** the config file */
private File _locationFile;
/** Ordered list of LogRecord elements that have not been written out yet */
private List _records;
private /* FIXME final FIXME */ List _records;
/** List of explicit overrides of log levels (LogLimit objects) */
private List _limits;
private /* FIXME final FIXME */ List _limits;
/** String (scope) to Log object */
private Map _logs;
private /* FIXME final FIXME */ Map _logs;
/** who clears and writes our records */
private LogWriter _writer;

View File

@ -24,8 +24,6 @@ import freenet.support.CPUInformation.IntelCPUInfo;
import freenet.support.CPUInformation.UnknownCPUException;
import net.i2p.I2PAppContext;
import net.i2p.util.FileUtil;
import net.i2p.util.Log;
/**
* <p>BigInteger that takes advantage of the jbigi library for the modPow operation,

View File

@ -40,7 +40,7 @@ public class OrderedProperties extends Properties {
private Map _data;
/** lock this before touching _order or _data */
private Object _lock = new Object();
private final Object _lock = new Object();
public OrderedProperties() {
super();
@ -269,6 +269,7 @@ public class OrderedProperties extends Properties {
return -2;
}
/* FIXME missing hashCode() method FIXME */
@Override
public boolean equals(Object o) {
if (o == null) return false;

View File

@ -169,16 +169,16 @@ public class ResettableGZIPInputStream extends InflaterInputStream {
// handle flags...
if (0 != (flags & (1<<5))) {
// extra header, read and ignore
int len = 0;
int _len = 0;
c = in.read();
if (c == -1) throw new IOException("EOF reading the extra header");
len = c;
_len = c;
c = in.read();
if (c == -1) throw new IOException("EOF reading the extra header");
len += (c << 8);
_len += (c << 8);
// now skip that data
for (int i = 0; i < len; i++) {
for (int i = 0; i < _len; i++) {
c = in.read();
if (c == -1) throw new IOException("EOF reading the extra header's body");
}

View File

@ -14,7 +14,7 @@ import net.i2p.data.DataHelper;
*
*/
public class ReusableGZIPInputStream extends ResettableGZIPInputStream {
private static ArrayList _available = new ArrayList(8);
private final static ArrayList _available = new ArrayList(8);
/**
* Pull a cached instance
*/

View File

@ -14,7 +14,7 @@ import net.i2p.data.DataHelper;
*
*/
public class ReusableGZIPOutputStream extends ResettableGZIPOutputStream {
private static ArrayList _available = new ArrayList(16);
private static final ArrayList _available = new ArrayList(16);
/**
* Pull a cached instance
*/

View File

@ -51,7 +51,7 @@ public class ShellCommand {
*/
private class CommandThread extends Thread {
Object caller;
final Object caller;
boolean consumeOutput;
String shellCommand;

Some files were not shown because too many files have changed in this diff Show More