diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ConnThrottler.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ConnThrottler.java index 385310055..c802a9995 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ConnThrottler.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ConnThrottler.java @@ -52,7 +52,7 @@ class ConnThrottler { public ConnThrottler(int max, int totalMax, long period, long throttlePeriod, long totalThrottlePeriod, String action, Log log) { updateLimits(max, totalMax, period, throttlePeriod, totalThrottlePeriod); - _peers = new HashMap(4); + _peers = new HashMap(4); _action = action; _log = log; // for logging @@ -143,7 +143,7 @@ class ConnThrottler { private long until; public Record() { - times = new ArrayList(8); + times = new ArrayList(8); increment(); } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java index 1cdf6f29e..e48a6bc56 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java @@ -46,7 +46,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Locale; -import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.StringTokenizer; @@ -99,10 +98,10 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging { private static final String nocli_args[] = { "-nocli", "-die"}; - private final List tasks = new ArrayList(); + private final List tasks = new ArrayList(); private int next_task_id = 1; - private final Set listeners = new CopyOnWriteArraySet(); + private final Set listeners = new CopyOnWriteArraySet(); public static void main(String[] args) throws IOException { new I2PTunnel(args); @@ -124,7 +123,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging { // as of 0.8.4, include context properties Properties p = _context.getProperties(); _clientOptions = p; - _sessions = new CopyOnWriteArraySet(); + _sessions = new CopyOnWriteArraySet(); addConnectionEventListener(lsnr); boolean gui = true; @@ -196,7 +195,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging { /** @return A copy, non-null */ List getSessions() { - return new ArrayList(_sessions); + return new ArrayList(_sessions); } void addSession(I2PSession session) { @@ -1506,7 +1505,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging { * */ private void purgetasks(Logging l) { - List removed = new ArrayList(); + List removed = new ArrayList(); for (I2PTunnelTask t : tasks) { if (!t.isOpen()) { _log.debug(getPrefix() + "Purging inactive tunnel: [" + t.getId() + "] " + t.toString()); @@ -1668,8 +1667,8 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging { */ void routerDisconnected() { _log.error(getPrefix() + "Router disconnected - firing notification events"); - for (Iterator iter = listeners.iterator(); iter.hasNext();) { - ConnectionEventListener lsnr = (ConnectionEventListener) iter.next(); + for (Iterator iter = listeners.iterator(); iter.hasNext();) { + ConnectionEventListener lsnr = iter.next(); if (lsnr != null) lsnr.routerDisconnected(); } } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java index e99b9a1b6..8adb79bb6 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java @@ -43,13 +43,13 @@ public class I2PTunnelClient extends I2PTunnelClientBase { "Standard client on " + tunnel.listenHost + ':' + localPort, tunnel, pkf); - _addrs = new ArrayList(1); + _addrs = new ArrayList(1); if (waitEventValue("openBaseClientResult").equals("error")) { notifyEvent("openClientResult", "error"); return; } - dests = new ArrayList(1); + dests = new ArrayList(1); buildAddresses(destinations); if (_addrs.isEmpty()) { diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java index 381a113be..807818d44 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java @@ -48,7 +48,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna protected long _clientId; protected final Object sockLock = new Object(); // Guards sockMgr and mySockets protected I2PSocketManager sockMgr; // should be final and use a factory. LINT - protected final List mySockets = new ArrayList(); + protected final List mySockets = new ArrayList(); protected boolean _ownDest; protected Destination dest = null; @@ -678,7 +678,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna private static class CustomThreadPoolExecutor extends ThreadPoolExecutor { public CustomThreadPoolExecutor() { super(0, Integer.MAX_VALUE, HANDLER_KEEPALIVE_MS, TimeUnit.MILLISECONDS, - new SynchronousQueue(), new CustomThreadFactory()); + new SynchronousQueue(), new CustomThreadFactory()); } } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java index f05600a9e..95221c477 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelConnectClient.java @@ -3,7 +3,6 @@ */ package net.i2p.i2ptunnel; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index 3ab3e6709..a0e940578 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -3,7 +3,6 @@ */ package net.i2p.i2ptunnel; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -70,7 +69,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn * Map of host name to base64 destination for destinations collected * via address helper links */ - private final ConcurrentHashMap addressHelpers = new ConcurrentHashMap(8); + private final ConcurrentHashMap addressHelpers = new ConcurrentHashMap(8); /** * Used to protect actions via http://proxy.i2p/ diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java index 3209b6ad2..2ae58a398 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java @@ -94,10 +94,10 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem EventDispatcher notifyThis, String handlerName, I2PTunnel tunnel) throws IllegalArgumentException { super(localPort, ownDest, l, notifyThis, handlerName, tunnel); - _proxyList = new ArrayList(4); + _proxyList = new ArrayList(4); _proxyNonce = new byte[PROXYNONCE_BYTES]; _context.random().nextBytes(_proxyNonce); - _nonces = new ConcurrentHashMap(); + _nonces = new ConcurrentHashMap(); } /** @@ -110,10 +110,10 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem I2PTunnel tunnel, EventDispatcher notifyThis, long clientId ) throws IllegalArgumentException { super(localPort, l, sktMgr, tunnel, notifyThis, clientId); - _proxyList = new ArrayList(4); + _proxyList = new ArrayList(4); _proxyNonce = new byte[PROXYNONCE_BYTES]; _context.random().nextBytes(_proxyNonce); - _nonces = new ConcurrentHashMap(); + _nonces = new ConcurrentHashMap(); } //////// Authorization stuff @@ -409,7 +409,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem * @since 0.9.4 */ private static Map parseArgs(String args) { - Map rv = new HashMap(8); + Map rv = new HashMap(8); char data[] = args.toCharArray(); StringBuilder buf = new StringBuilder(32); boolean isQuoted = false; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java index 5e1b76fc7..c74dad266 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.Properties; import java.util.StringTokenizer; -import net.i2p.I2PException; import net.i2p.client.streaming.I2PSocket; import net.i2p.client.streaming.I2PSocketAddress; import net.i2p.data.Base32; @@ -60,7 +59,7 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase { notifyThis, "IRC Client on " + tunnel.listenHost + ':' + localPort, tunnel, pkf); - _addrs = new ArrayList(4); + _addrs = new ArrayList(4); buildAddresses(destinations); if (_addrs.isEmpty()) { diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java index e8112ad18..8d5f4ff4b 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java @@ -27,7 +27,6 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.ThreadFactory; -import net.i2p.I2PAppContext; import net.i2p.I2PException; import net.i2p.client.I2PSessionException; import net.i2p.client.streaming.I2PServerSocket; @@ -77,7 +76,7 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable { protected I2PTunnelTask task; protected boolean bidir; private ThreadPoolExecutor _executor; - private final Map _socketMap = new ConcurrentHashMap(4); + private final Map _socketMap = new ConcurrentHashMap(4); /** unused? port should always be specified */ private int DEFAULT_LOCALPORT = 4488; @@ -321,7 +320,7 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable { synchronized (lock) { if (!forced && sockMgr.listSockets().size() != 0) { l.log("There are still active connections!"); - for (Iterator it = sockMgr.listSockets().iterator(); it.hasNext();) { + for (Iterator it = sockMgr.listSockets().iterator(); it.hasNext();) { l.log("->" + it.next()); } return false; @@ -473,7 +472,7 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable { private static class CustomThreadPoolExecutor extends ThreadPoolExecutor { public CustomThreadPoolExecutor(int max, String name) { super(MIN_HANDLERS, max, HANDLER_KEEPALIVE_MS, TimeUnit.MILLISECONDS, - new SynchronousQueue(), new CustomThreadFactory(name)); + new SynchronousQueue(), new CustomThreadFactory(name)); } } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java index 3da0ba275..3ab952a95 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2Ping.java @@ -123,7 +123,7 @@ public class I2Ping extends I2PTunnelTask implements Runnable { } else if (cmd.startsWith("-l ")) { // ping a list of hosts BufferedReader br = new BufferedReader(new FileReader(cmd.substring(3))); String line; - List pingHandlers = new ArrayList(); + List pingHandlers = new ArrayList(); int i = 0; while ((line = br.readLine()) != null) { if (line.startsWith("#")) continue; // comments @@ -137,7 +137,7 @@ public class I2Ping extends I2PTunnelTask implements Runnable { reportTimes = false; } br.close(); - for (Iterator it = pingHandlers.iterator(); it.hasNext();) { + for (Iterator it = pingHandlers.iterator(); it.hasNext();) { Thread t = (Thread) it.next(); t.join(); } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java index 821d325cd..a02de79b2 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java @@ -4,13 +4,9 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.Random; - import net.i2p.I2PAppContext; import net.i2p.I2PException; import net.i2p.client.I2PClient; @@ -70,7 +66,7 @@ public class TunnelController implements Logging { _tunnel = new I2PTunnel(); _log = I2PAppContext.getGlobalContext().logManager().getLog(TunnelController.class); setConfig(config, prefix); - _messages = new ArrayList(4); + _messages = new ArrayList(4); _running = false; boolean keyOK = true; if (createKey && (getType().endsWith("server") || getPersistentClientKey())) @@ -741,9 +737,9 @@ public class TunnelController implements Logging { * @return list of messages pulled off (each is a String, earliest first) */ public List clearMessages() { - List rv = null; + List rv = null; synchronized (this) { - rv = new ArrayList(_messages); + rv = new ArrayList(_messages); _messages.clear(); } return rv; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelControllerGroup.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelControllerGroup.java index d20d0be55..a0614dceb 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelControllerGroup.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelControllerGroup.java @@ -3,7 +3,6 @@ package net.i2p.i2ptunnel; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -83,14 +82,14 @@ public class TunnelControllerGroup implements ClientApp { _context = context; _mgr = mgr; _log = _context.logManager().getLog(TunnelControllerGroup.class); - _controllers = new ArrayList(); + _controllers = new ArrayList(); if (args == null || args.length <= 0) _configFile = DEFAULT_CONFIG_FILE; else if (args.length == 1) _configFile = args[0]; else throw new IllegalArgumentException("Usage: TunnelControllerGroup [filename]"); - _sessions = new HashMap(4); + _sessions = new HashMap>(4); synchronized (TunnelControllerGroup.class) { if (_instance == null) _instance = this; @@ -288,7 +287,7 @@ public class TunnelControllerGroup implements ClientApp { * @return list of messages from the controller as it is stopped */ public synchronized List removeController(TunnelController controller) { - if (controller == null) return new ArrayList(); + if (controller == null) return new ArrayList(); controller.stopTunnel(); List msgs = controller.clearMessages(); _controllers.remove(controller); @@ -302,7 +301,7 @@ public class TunnelControllerGroup implements ClientApp { * @return list of messages the tunnels generate when stopped */ public synchronized List stopAllControllers() { - List msgs = new ArrayList(); + List msgs = new ArrayList(); for (int i = 0; i < _controllers.size(); i++) { TunnelController controller = _controllers.get(i); controller.stopTunnel(); @@ -319,7 +318,7 @@ public class TunnelControllerGroup implements ClientApp { * @return list of messages the tunnels generate when started */ public synchronized List startAllControllers() { - List msgs = new ArrayList(); + List msgs = new ArrayList(); for (int i = 0; i < _controllers.size(); i++) { TunnelController controller = _controllers.get(i); controller.startTunnelBackground(); @@ -337,7 +336,7 @@ public class TunnelControllerGroup implements ClientApp { * @return list of messages the tunnels generate when restarted */ public synchronized List restartAllControllers() { - List msgs = new ArrayList(); + List msgs = new ArrayList(); for (int i = 0; i < _controllers.size(); i++) { TunnelController controller = _controllers.get(i); controller.restartTunnel(); @@ -354,7 +353,7 @@ public class TunnelControllerGroup implements ClientApp { * @return list of messages the tunnels have generated */ public synchronized List clearAllMessages() { - List msgs = new ArrayList(); + List msgs = new ArrayList(); for (int i = 0; i < _controllers.size(); i++) { TunnelController controller = _controllers.get(i); msgs.addAll(controller.clearMessages()); @@ -426,7 +425,7 @@ public class TunnelControllerGroup implements ClientApp { * @return list of TunnelController objects */ public synchronized List getControllers() { - return new ArrayList(_controllers); + return new ArrayList(_controllers); } @@ -439,7 +438,7 @@ public class TunnelControllerGroup implements ClientApp { synchronized (_sessions) { Set owners = _sessions.get(session); if (owners == null) { - owners = new HashSet(2); + owners = new HashSet(2); _sessions.put(session, owners); } owners.add(controller); diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/DCCClientManager.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/DCCClientManager.java index f98f8d0ab..42af9abf2 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/DCCClientManager.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/DCCClientManager.java @@ -55,9 +55,9 @@ public class DCCClientManager extends EventReceiver { _dispatch = dispatch; _tunnel = tunnel; _log = tunnel.getContext().logManager().getLog(DCCClientManager.class); - _incoming = new ConcurrentHashMap(8); - _active = new ConcurrentHashMap(8); - _complete = new ConcurrentHashMap(8); + _incoming = new ConcurrentHashMap(8); + _active = new ConcurrentHashMap(8); + _complete = new ConcurrentHashMap(8); } public boolean close(boolean forced) { diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/I2PTunnelDCCServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/I2PTunnelDCCServer.java index 8b4a3e295..48e53dd57 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/I2PTunnelDCCServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/I2PTunnelDCCServer.java @@ -75,10 +75,10 @@ public class I2PTunnelDCCServer extends I2PTunnelServer { public I2PTunnelDCCServer(I2PSocketManager sktMgr, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel) { super(DUMMY, 0, sktMgr, l, notifyThis, tunnel); - _outgoing = new ConcurrentHashMap(8); - _active = new ConcurrentHashMap(8); - _resume = new ConcurrentHashMap(8); - _sockList = new CopyOnWriteArrayList(); + _outgoing = new ConcurrentHashMap(8); + _active = new ConcurrentHashMap(8); + _resume = new ConcurrentHashMap(8); + _sockList = new CopyOnWriteArrayList(); } /** diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IRCFilter.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IRCFilter.java index f4c7e1ec3..a995285f4 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IRCFilter.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IRCFilter.java @@ -232,7 +232,7 @@ abstract class IRCFilter { "WALLOPS", "ZLINE" }; - _allowedOutbound = new HashSet(Arrays.asList(allowedCommands)); + _allowedOutbound = new HashSet(Arrays.asList(allowedCommands)); } /************************************************************************* diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java index a61082fbf..1368580c7 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java @@ -17,7 +17,6 @@ import net.i2p.data.DataFormatException; import net.i2p.data.Destination; import net.i2p.i2ptunnel.I2PTunnelHTTPClient; import net.i2p.util.FileUtil; -import net.i2p.util.Log; import net.i2p.util.Translate; /** @@ -119,7 +118,7 @@ public abstract class LocalHTTPServer { // Parameters are url, host, dest, nonce, and master | router | private. // Do the add and redirect. if (targetRequest.equals("/add")) { - Map opts = new HashMap(8); + Map opts = new HashMap(8); // this only works if all keys are followed by =value StringTokenizer tok = new StringTokenizer(query, "=&;"); while (tok.hasMoreTokens()) { diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/I2PSOCKSTunnel.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/I2PSOCKSTunnel.java index 1cf873966..b66d613a8 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/I2PSOCKSTunnel.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/I2PSOCKSTunnel.java @@ -69,13 +69,13 @@ public class I2PSOCKSTunnel extends I2PTunnelClientBase { private void parseOptions() { Properties opts = getTunnel().getClientOptions(); - proxies = new HashMap(1); + proxies = new HashMap>(1); for (Map.Entry e : opts.entrySet()) { String prop = (String)e.getKey(); if ((!prop.startsWith(PROP_PROXY_PREFIX)) || prop.length() <= PROP_PROXY_PREFIX.length()) continue; String port = prop.substring(PROP_PROXY_PREFIX.length()); - List proxyList = new ArrayList(1); + List proxyList = new ArrayList(1); StringTokenizer tok = new StringTokenizer((String)e.getValue(), ", \t"); while (tok.hasMoreTokens()) { String proxy = tok.nextToken().trim(); diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/MultiSink.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/MultiSink.java index 3c63758c1..dde5f01b0 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/MultiSink.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/MultiSink.java @@ -10,10 +10,10 @@ import net.i2p.util.Log; * Sends to one of many Sinks * @author zzz modded from streamr/MultiSource */ -public class MultiSink implements Source, Sink { +public class MultiSink implements Source, Sink { private static final Log _log = new Log(MultiSink.class); - public MultiSink(Map cache) { + public MultiSink(Map cache) { this.cache = cache; } @@ -31,5 +31,5 @@ public class MultiSink implements Source, Sink { s.send(from, data); } - private Map cache; + private Map cache; } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/ReplyTracker.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/ReplyTracker.java index fbdf2939d..6495235a9 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/ReplyTracker.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/ReplyTracker.java @@ -10,10 +10,10 @@ import net.i2p.util.Log; * Track who the reply goes to * @author zzz */ -public class ReplyTracker implements Source, Sink { +public class ReplyTracker implements Source, Sink { private static final Log _log = new Log(MultiSink.class); - public ReplyTracker(Sink reply, Map cache) { + public ReplyTracker(S reply, Map cache) { this.reply = reply; this.cache = cache; } @@ -29,7 +29,7 @@ public class ReplyTracker implements Source, Sink { this.sink.send(to, data); } - private Sink reply; - private Map cache; + private S reply; + private Map cache; private Sink sink; } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java index edbaa8859..c4412346b 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java @@ -597,7 +597,7 @@ public class SOCKS5Server extends SOCKSServer { * RFC 1928 isn't clear... maybe not. */ private void handleUDP(DataInputStream in, DataOutputStream out) throws SOCKSException { - List ports = new ArrayList(1); + List ports = new ArrayList(1); synchronized (_startLock) { if (_tunnel == null) { // tunnel options? diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSUDPPort.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSUDPPort.java index b56c9082f..1f414f134 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSUDPPort.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSUDPPort.java @@ -26,10 +26,10 @@ import net.i2p.i2ptunnel.udp.*; */ public class SOCKSUDPPort implements Source, Sink { - public SOCKSUDPPort(InetAddress host, int port, Map replyMap) { + public SOCKSUDPPort(InetAddress host, int port, Map replyMap) { // this passes the host and port from UDPUnwrapper to UDPWrapper - Map cache = new ConcurrentHashMap(4); + Map cache = new ConcurrentHashMap(4); // rcv from I2P and send to a port this.wrapper = new SOCKSUDPWrapper(cache); @@ -41,7 +41,7 @@ public class SOCKSUDPPort implements Source, Sink { this.udpsource = new UDPSource(sock); this.unwrapper = new SOCKSUDPUnwrapper(cache); this.udpsource.setSink(this.unwrapper); - this.udptracker = new ReplyTracker(this, replyMap); + this.udptracker = new ReplyTracker(this, replyMap); this.unwrapper.setSink(this.udptracker); } @@ -73,5 +73,5 @@ public class SOCKSUDPPort implements Source, Sink { private UDPSource udpsource; private SOCKSUDPWrapper wrapper; private SOCKSUDPUnwrapper unwrapper; - private ReplyTracker udptracker; + private ReplyTracker udptracker; } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSUDPTunnel.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSUDPTunnel.java index 0490a6f0a..044b00057 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSUDPTunnel.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSUDPTunnel.java @@ -4,7 +4,6 @@ import java.net.InetAddress; import java.util.concurrent.ConcurrentHashMap; import java.util.Iterator; import java.util.Map; - import net.i2p.data.Destination; import net.i2p.i2ptunnel.I2PTunnel; import net.i2p.i2ptunnel.udpTunnel.I2PTunnelUDPClientBase; @@ -33,9 +32,9 @@ public class SOCKSUDPTunnel extends I2PTunnelUDPClientBase { public SOCKSUDPTunnel(I2PTunnel tunnel) { super(null, tunnel, tunnel, tunnel); - this.ports = new ConcurrentHashMap(1); - this.cache = new ConcurrentHashMap(1); - this.demuxer = new MultiSink(this.cache); + this.ports = new ConcurrentHashMap(1); + this.cache = new ConcurrentHashMap(1); + this.demuxer = new MultiSink(this.cache); setSink(this.demuxer); } @@ -53,8 +52,8 @@ public class SOCKSUDPTunnel extends I2PTunnelUDPClientBase { SOCKSUDPPort sup = this.ports.remove(port); if (sup != null) sup.stop(); - for (Iterator iter = cache.entrySet().iterator(); iter.hasNext();) { - Map.Entry e = (Map.Entry) iter.next(); + for (Iterator> iter = cache.entrySet().iterator(); iter.hasNext();) { + Map.Entry e = iter.next(); if (e.getValue() == sup) iter.remove(); } @@ -89,5 +88,5 @@ public class SOCKSUDPTunnel extends I2PTunnelUDPClientBase { private Map ports; private Map cache; - private MultiSink demuxer; + private MultiSink demuxer; } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Subscriber.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Subscriber.java index f93d87404..8dfcbb3cb 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Subscriber.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Subscriber.java @@ -8,8 +8,6 @@ package net.i2p.i2ptunnel.streamr; // system import java.util.Set; -// i2p -import net.i2p.client.I2PSession; import net.i2p.data.Destination; import net.i2p.i2ptunnel.udp.*; import net.i2p.util.ConcurrentHashSet; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/udp/I2PSource.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/udp/I2PSource.java index 0b5474777..04a8bde6a 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/udp/I2PSource.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/udp/I2PSource.java @@ -32,7 +32,7 @@ public class I2PSource implements Source, Runnable { this.raw = raw; // create queue - this.queue = new ArrayBlockingQueue(256); + this.queue = new ArrayBlockingQueue(256); // create listener this.sess.setSessionListener(new Listener()); diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/udpTunnel/I2PTunnelUDPClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/udpTunnel/I2PTunnelUDPClientBase.java index f43901948..20551aabb 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/udpTunnel/I2PTunnelUDPClientBase.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/udpTunnel/I2PTunnelUDPClientBase.java @@ -5,7 +5,6 @@ package net.i2p.i2ptunnel.udpTunnel; import java.io.ByteArrayOutputStream; import java.io.ByteArrayInputStream; -import java.net.ServerSocket; import java.util.concurrent.atomic.AtomicLong; import net.i2p.I2PAppContext; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java index 3c3c9e44c..c3160b841 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java @@ -8,11 +8,9 @@ package net.i2p.i2ptunnel.web; * */ -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.StringTokenizer; import java.util.Set; import java.util.TreeMap; @@ -43,9 +41,9 @@ public class EditBean extends IndexBean { TunnelControllerGroup group = TunnelControllerGroup.getInstance(); if (group == null) return false; - List controllers = group.getControllers(); + List controllers = group.getControllers(); if (controllers.size() > tunnel) { - TunnelController cur = (TunnelController)controllers.get(tunnel); + TunnelController cur = controllers.get(tunnel); if (cur == null) return false; return isClient(cur.getType()); } else { @@ -374,7 +372,7 @@ public class EditBean extends IndexBean { if (opts == null) return ""; boolean isMD5Proxy = "httpclient".equals(tun.getType()) || "connectclient".equals(tun.getType()); - Map sorted = new TreeMap(); + Map sorted = new TreeMap(); for (Map.Entry e : opts.entrySet()) { String key = (String)e.getKey(); if (_noShowSet.contains(key)) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java index 99ff7af59..56be5d3a8 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -102,7 +102,7 @@ public class IndexBean { /** 3 wasn't enough for some browsers. They are reloading the page for some reason - maybe HEAD? @since 0.8.1 */ private static final int MAX_NONCES = 8; /** store nonces in a static FIFO instead of in System Properties @since 0.8.1 */ - private static final List _nonces = new ArrayList(MAX_NONCES + 1); + private static final List _nonces = new ArrayList(MAX_NONCES + 1); static final String CLIENT_NICKNAME = "shared clients"; public static final String PROP_THEME_NAME = "routerconsole.theme"; @@ -129,8 +129,8 @@ public class IndexBean { _tunnel = -1; _curNonce = "-1"; addNonce(); - _booleanOptions = new ConcurrentHashSet(4); - _otherOptions = new ConcurrentHashMap(4); + _booleanOptions = new ConcurrentHashSet(4); + _otherOptions = new ConcurrentHashMap(4); } /** @@ -1224,8 +1224,8 @@ public class IndexBean { "proxyUsername", "proxyPassword" }; - protected static final Set _noShowSet = new HashSet(128); - protected static final Set _nonProxyNoShowSet = new HashSet(4); + protected static final Set _noShowSet = new HashSet(128); + protected static final Set _nonProxyNoShowSet = new HashSet(4); static { _noShowSet.addAll(Arrays.asList(_noShowOpts)); _noShowSet.addAll(Arrays.asList(_booleanClientOpts));