forked from I2P_Developers/i2p.i2p
streaming: type arguments, unused imports
This commit is contained in:
@ -15,7 +15,6 @@ import net.i2p.client.I2PSession;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SimpleScheduler;
|
||||
import net.i2p.util.SimpleTimer;
|
||||
import net.i2p.util.SimpleTimer2;
|
||||
|
||||
@ -125,7 +124,7 @@ class Connection {
|
||||
// FIXME pass through a passive flush delay setting as the 4th arg
|
||||
_outputStream = new MessageOutputStream(_context, timer, _receiver, (opts == null ? Packet.MAX_PAYLOAD_SIZE : opts.getMaxMessageSize()));
|
||||
_timer = timer;
|
||||
_outboundPackets = new TreeMap();
|
||||
_outboundPackets = new TreeMap<Long, PacketLocal>();
|
||||
if (opts != null) {
|
||||
_localPort = opts.getLocalPort();
|
||||
_remotePort = opts.getPort();
|
||||
@ -469,7 +468,7 @@ class Connection {
|
||||
}
|
||||
if (!nacked) { // aka ACKed
|
||||
if (acked == null)
|
||||
acked = new ArrayList(8);
|
||||
acked = new ArrayList<PacketLocal>(8);
|
||||
PacketLocal ackedPacket = e.getValue();
|
||||
ackedPacket.ackReceived();
|
||||
acked.add(ackedPacket);
|
||||
|
@ -6,7 +6,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SimpleScheduler;
|
||||
import net.i2p.util.SimpleTimer;
|
||||
|
||||
/**
|
||||
|
@ -767,13 +767,13 @@ class ConnectionOptions extends I2PSocketOptionsImpl {
|
||||
// but avoid concurrent modification just in case
|
||||
Set<Hash> accessList, blackList;
|
||||
if (accessListEnabled)
|
||||
accessList = new HashSet();
|
||||
accessList = new HashSet<Hash>();
|
||||
else
|
||||
accessList = Collections.EMPTY_SET;
|
||||
accessList = Collections.emptySet();
|
||||
if (blackListEnabled)
|
||||
blackList = new HashSet();
|
||||
blackList = new HashSet<Hash>();
|
||||
else
|
||||
blackList = Collections.EMPTY_SET;
|
||||
blackList = Collections.emptySet();
|
||||
if (accessListEnabled || blackListEnabled) {
|
||||
String hashes = opts.getProperty(PROP_ACCESS_LIST);
|
||||
if (hashes == null)
|
||||
|
@ -7,7 +7,6 @@ import net.i2p.I2PException;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SimpleScheduler;
|
||||
import net.i2p.util.SimpleTimer;
|
||||
|
||||
/**
|
||||
|
@ -8,6 +8,7 @@ import net.i2p.I2PAppContext;
|
||||
import net.i2p.client.I2PSession;
|
||||
import net.i2p.client.I2PSessionException;
|
||||
import net.i2p.client.I2PSessionMuxedListener;
|
||||
import net.i2p.client.streaming.I2PSocketManager.DisconnectListener;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
@ -25,7 +26,7 @@ class MessageHandler implements I2PSessionMuxedListener {
|
||||
public MessageHandler(I2PAppContext ctx, ConnectionManager mgr) {
|
||||
_manager = mgr;
|
||||
_context = ctx;
|
||||
_listeners = new CopyOnWriteArraySet();
|
||||
_listeners = new CopyOnWriteArraySet<DisconnectListener>();
|
||||
_log = ctx.logManager().getLog(MessageHandler.class);
|
||||
_context.statManager().createRateStat("stream.packetReceiveFailure", "When do we fail to decrypt or otherwise receive a packet sent to us?", "Stream", new long[] { 60*60*1000, 24*60*60*1000 });
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InterruptedIOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -63,11 +62,11 @@ class MessageInputStream extends InputStream {
|
||||
|
||||
public MessageInputStream(I2PAppContext ctx) {
|
||||
_log = ctx.logManager().getLog(MessageInputStream.class);
|
||||
_readyDataBlocks = new ArrayList(4);
|
||||
_readyDataBlocks = new ArrayList<ByteArray>(4);
|
||||
_highestReadyBlockId = -1;
|
||||
_highestBlockId = -1;
|
||||
_readTimeout = -1;
|
||||
_notYetReadyBlocks = new HashMap(4);
|
||||
_notYetReadyBlocks = new HashMap<Long, ByteArray>(4);
|
||||
_dataLock = new Object();
|
||||
//_cache = ByteCache.getInstance(128, Packet.MAX_PAYLOAD_SIZE);
|
||||
}
|
||||
@ -110,7 +109,7 @@ class MessageInputStream extends InputStream {
|
||||
// ACK
|
||||
} else {
|
||||
if (ids == null)
|
||||
ids = new ArrayList(4);
|
||||
ids = new ArrayList<Long>(4);
|
||||
ids.add(l);
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,6 @@ package net.i2p.client.streaming;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.I2PException;
|
||||
import net.i2p.data.Destination;
|
||||
|
@ -9,7 +9,6 @@ import java.io.OutputStream;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.DataFormatException;
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Hash;
|
||||
|
||||
/**
|
||||
* Write a standard pcap file with a "TCP" packet that can be analyzed with
|
||||
|
@ -36,8 +36,8 @@ class SchedulerChooser {
|
||||
return _nullScheduler;
|
||||
}
|
||||
|
||||
private List createSchedulers() {
|
||||
List rv = new ArrayList(8);
|
||||
private List<TaskScheduler> createSchedulers() {
|
||||
List<TaskScheduler> rv = new ArrayList<TaskScheduler>(8);
|
||||
rv.add(new SchedulerHardDisconnected(_context));
|
||||
rv.add(new SchedulerPreconnect(_context));
|
||||
rv.add(new SchedulerConnecting(_context));
|
||||
|
@ -2,7 +2,6 @@ package net.i2p.client.streaming;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.Log;
|
||||
import net.i2p.util.SimpleScheduler;
|
||||
|
||||
/**
|
||||
* Base scheduler
|
||||
|
@ -6,7 +6,6 @@ import org.junit.Test;
|
||||
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.client.I2PClient;
|
||||
import net.i2p.client.I2PSession;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
|
@ -6,7 +6,6 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.client.I2PClient;
|
||||
import net.i2p.client.I2PSession;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
|
@ -6,7 +6,6 @@ import java.util.Properties;
|
||||
import org.junit.Test;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.client.I2PClient;
|
||||
import net.i2p.client.I2PClientFactory;
|
||||
import net.i2p.client.I2PSession;
|
||||
import net.i2p.data.Destination;
|
||||
|
@ -9,7 +9,6 @@ import org.junit.Test;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.client.I2PSession;
|
||||
import net.i2p.data.Base64;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
|
@ -59,7 +59,7 @@ public class MessageInputStreamTest extends TestCase {
|
||||
_context.random().nextBytes(orig);
|
||||
|
||||
MessageInputStream in = new MessageInputStream(_context);
|
||||
ArrayList order = new ArrayList(32);
|
||||
ArrayList<Integer> order = new ArrayList<Integer>(32);
|
||||
for (int i = 0; i < orig.length / 1024; i++)
|
||||
order.add(new Integer(i));
|
||||
Collections.shuffle(order);
|
||||
@ -92,7 +92,7 @@ public class MessageInputStreamTest extends TestCase {
|
||||
|
||||
MessageInputStream in = new MessageInputStream(_context);
|
||||
for (int n = 0; n < 3; n++) {
|
||||
ArrayList order = new ArrayList(32);
|
||||
ArrayList<Integer> order = new ArrayList<Integer>(32);
|
||||
for (int i = 0; i < orig.length / 1024; i++)
|
||||
order.add(new Integer(i));
|
||||
Collections.shuffle(order);
|
||||
@ -126,7 +126,7 @@ public class MessageInputStreamTest extends TestCase {
|
||||
_context.random().nextBytes(orig);
|
||||
|
||||
MessageInputStream in = new MessageInputStream(_context);
|
||||
ArrayList order = new ArrayList(32);
|
||||
ArrayList<Integer> order = new ArrayList<Integer>(32);
|
||||
for (int i = 0; i < orig.length / 1024; i++)
|
||||
order.add(new Integer(i));
|
||||
Collections.shuffle(order);
|
||||
|
Reference in New Issue
Block a user