routerconsole: type arguments, unused imports

This commit is contained in:
str4d
2013-11-21 11:31:50 +00:00
parent bff79cdae8
commit 2f4765665d
51 changed files with 121 additions and 184 deletions

View File

@ -9,8 +9,6 @@ import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -25,7 +23,6 @@ import net.i2p.data.DataHelper;
import net.i2p.router.Router; import net.i2p.router.Router;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.RouterVersion; import net.i2p.router.RouterVersion;
import net.i2p.router.util.RFC822Date;
import net.i2p.router.web.ConfigServiceHandler; import net.i2p.router.web.ConfigServiceHandler;
import net.i2p.router.web.ConfigUpdateHandler; import net.i2p.router.web.ConfigUpdateHandler;
import net.i2p.router.web.Messages; import net.i2p.router.web.Messages;
@ -37,7 +34,6 @@ import static net.i2p.update.UpdateMethod.*;
import net.i2p.util.ConcurrentHashSet; import net.i2p.util.ConcurrentHashSet;
import net.i2p.util.FileUtil; import net.i2p.util.FileUtil;
import net.i2p.util.Log; import net.i2p.util.Log;
import net.i2p.util.SimpleScheduler;
import net.i2p.util.SimpleTimer; import net.i2p.util.SimpleTimer;
import net.i2p.util.VersionComparator; import net.i2p.util.VersionComparator;
@ -84,13 +80,13 @@ public class ConsoleUpdateManager implements UpdateManager {
public ConsoleUpdateManager(RouterContext ctx) { public ConsoleUpdateManager(RouterContext ctx) {
_context = ctx; _context = ctx;
_log = ctx.logManager().getLog(ConsoleUpdateManager.class); _log = ctx.logManager().getLog(ConsoleUpdateManager.class);
_registeredUpdaters = new ConcurrentHashSet(); _registeredUpdaters = new ConcurrentHashSet<RegisteredUpdater>();
_registeredCheckers = new ConcurrentHashSet(); _registeredCheckers = new ConcurrentHashSet<RegisteredChecker>();
_activeCheckers = new ConcurrentHashSet(); _activeCheckers = new ConcurrentHashSet<UpdateTask>();
_downloaders = new ConcurrentHashMap(); _downloaders = new ConcurrentHashMap<UpdateTask, List<RegisteredUpdater>>();
_available = new ConcurrentHashMap(); _available = new ConcurrentHashMap<UpdateItem, VersionAvailable>();
_downloaded = new ConcurrentHashMap(); _downloaded = new ConcurrentHashMap<UpdateItem, Version>();
_installed = new ConcurrentHashMap(); _installed = new ConcurrentHashMap<UpdateItem, Version>();
_status = ""; _status = "";
// DEBUG slow start for snark updates // DEBUG slow start for snark updates
// For 0.9.4 update, only for dev builds // For 0.9.4 update, only for dev builds
@ -111,7 +107,7 @@ public class ConsoleUpdateManager implements UpdateManager {
notifyInstalled(ROUTER_SIGNED_SU3, "", RouterVersion.VERSION); notifyInstalled(ROUTER_SIGNED_SU3, "", RouterVersion.VERSION);
// hack to init from the current news file... do this before we register Updaters // hack to init from the current news file... do this before we register Updaters
// This will not kick off any Updaters as none are yet registered // This will not kick off any Updaters as none are yet registered
(new NewsFetcher(_context, this, Collections.EMPTY_LIST)).checkForUpdates(); (new NewsFetcher(_context, this, Collections.<URI> emptyList())).checkForUpdates();
for (String plugin : PluginStarter.getPlugins()) { for (String plugin : PluginStarter.getPlugins()) {
Properties props = PluginStarter.pluginProperties(_context, plugin); Properties props = PluginStarter.pluginProperties(_context, plugin);
String ver = props.getProperty("version"); String ver = props.getProperty("version");
@ -123,7 +119,7 @@ public class ConsoleUpdateManager implements UpdateManager {
DummyHandler dh = new DummyHandler(_context, this); DummyHandler dh = new DummyHandler(_context, this);
register((Checker)dh, TYPE_DUMMY, METHOD_DUMMY, 0); register((Checker)dh, TYPE_DUMMY, METHOD_DUMMY, 0);
register((Updater)dh, TYPE_DUMMY, METHOD_DUMMY, 0); register((Updater)dh, TYPE_DUMMY, METHOD_DUMMY, 0);
VersionAvailable dummyVA = new VersionAvailable("", "", METHOD_DUMMY, Collections.EMPTY_LIST); VersionAvailable dummyVA = new VersionAvailable("", "", METHOD_DUMMY, Collections.<URI> emptyList());
_available.put(new UpdateItem(TYPE_DUMMY, ""), dummyVA); _available.put(new UpdateItem(TYPE_DUMMY, ""), dummyVA);
// register news before router, so we don't fire off an update // register news before router, so we don't fire off an update
// right at instantiation if the news is already indicating a new version // right at instantiation if the news is already indicating a new version
@ -526,7 +522,7 @@ public class ConsoleUpdateManager implements UpdateManager {
_log.warn("No version available for: " + type + ' ' + id); _log.warn("No version available for: " + type + ' ' + id);
return false; return false;
} }
List<RegisteredUpdater> sorted = new ArrayList(4); List<RegisteredUpdater> sorted = new ArrayList<RegisteredUpdater>(4);
for (RegisteredUpdater ru : _registeredUpdaters) { for (RegisteredUpdater ru : _registeredUpdaters) {
if (ru.type == type) if (ru.type == type)
sorted.add(ru); sorted.add(ru);
@ -1069,7 +1065,7 @@ public class ConsoleUpdateManager implements UpdateManager {
{ // avoid dup variables in next case { // avoid dup variables in next case
String URLs = _context.getProperty(ConfigUpdateHandler.PROP_UPDATE_URL, ConfigUpdateHandler.DEFAULT_UPDATE_URL); String URLs = _context.getProperty(ConfigUpdateHandler.PROP_UPDATE_URL, ConfigUpdateHandler.DEFAULT_UPDATE_URL);
StringTokenizer tok = new StringTokenizer(URLs, " ,\r\n"); StringTokenizer tok = new StringTokenizer(URLs, " ,\r\n");
List<URI> rv = new ArrayList(); List<URI> rv = new ArrayList<URI>();
while (tok.hasMoreTokens()) { while (tok.hasMoreTokens()) {
try { try {
rv.add(new URI(tok.nextToken().trim())); rv.add(new URI(tok.nextToken().trim()));
@ -1083,7 +1079,7 @@ public class ConsoleUpdateManager implements UpdateManager {
{ {
String URLs = ConfigUpdateHandler.SU3_UPDATE_URLS; String URLs = ConfigUpdateHandler.SU3_UPDATE_URLS;
StringTokenizer tok = new StringTokenizer(URLs, " ,\r\n"); StringTokenizer tok = new StringTokenizer(URLs, " ,\r\n");
List<URI> rv = new ArrayList(); List<URI> rv = new ArrayList<URI>();
while (tok.hasMoreTokens()) { while (tok.hasMoreTokens()) {
try { try {
rv.add(new URI(tok.nextToken().trim())); rv.add(new URI(tok.nextToken().trim()));
@ -1115,7 +1111,7 @@ public class ConsoleUpdateManager implements UpdateManager {
default: default:
break; break;
} }
return Collections.EMPTY_LIST; return Collections.emptyList();
} }
/** /**
@ -1494,7 +1490,7 @@ public class ConsoleUpdateManager implements UpdateManager {
public VersionAvailable(String version, String min, UpdateMethod method, List<URI> updateSources) { public VersionAvailable(String version, String min, UpdateMethod method, List<URI> updateSources) {
super(version); super(version);
minVersion = min; minVersion = min;
sourceMap = new ConcurrentHashMap(4); sourceMap = new ConcurrentHashMap<UpdateMethod, List<URI>>(4);
sourceMap.put(method, updateSources); sourceMap.put(method, updateSources);
} }
@ -1505,7 +1501,7 @@ public class ConsoleUpdateManager implements UpdateManager {
public VersionAvailable(String version, String constraint) { public VersionAvailable(String version, String constraint) {
super(version); super(version);
minVersion = ""; minVersion = "";
sourceMap = new ConcurrentHashMap(4); sourceMap = new ConcurrentHashMap<UpdateMethod, List<URI>>(4);
this.constraint = constraint; this.constraint = constraint;
} }
@ -1539,7 +1535,7 @@ public class ConsoleUpdateManager implements UpdateManager {
/** debug */ /** debug */
private static void toString(StringBuilder buf, Collection col) { private static void toString(StringBuilder buf, Collection col) {
List<String> list = new ArrayList(col.size()); List<String> list = new ArrayList<String>(col.size());
for (Object o : col) { for (Object o : col) {
list.add(o.toString()); list.add(o.toString());
} }
@ -1551,7 +1547,7 @@ public class ConsoleUpdateManager implements UpdateManager {
/** debug */ /** debug */
private static void toString(StringBuilder buf, Map<?, ?> map) { private static void toString(StringBuilder buf, Map<?, ?> map) {
List<String> list = new ArrayList(map.size()); List<String> list = new ArrayList<String>(map.size());
for (Map.Entry entry : map.entrySet()) { for (Map.Entry entry : map.entrySet()) {
String key = entry.getKey().toString(); String key = entry.getKey().toString();
String val = entry.getValue().toString(); String val = entry.getValue().toString();

View File

@ -48,7 +48,7 @@ class DummyHandler implements Checker, Updater {
private final long _delay; private final long _delay;
public DummyRunner(RouterContext ctx, ConsoleUpdateManager mgr, long maxTime) { public DummyRunner(RouterContext ctx, ConsoleUpdateManager mgr, long maxTime) {
super(ctx, mgr, UpdateType.TYPE_DUMMY, Collections.EMPTY_LIST); super(ctx, mgr, UpdateType.TYPE_DUMMY, Collections.<URI> emptyList());
_delay = maxTime; _delay = maxTime;
} }

View File

@ -5,10 +5,8 @@ import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
@ -17,18 +15,15 @@ import java.util.StringTokenizer;
import net.i2p.crypto.TrustedUpdate; import net.i2p.crypto.TrustedUpdate;
import net.i2p.data.DataHelper; import net.i2p.data.DataHelper;
import net.i2p.router.Router;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.RouterVersion; import net.i2p.router.RouterVersion;
import net.i2p.router.util.RFC822Date; import net.i2p.router.util.RFC822Date;
import net.i2p.router.web.ConfigUpdateHandler; import net.i2p.router.web.ConfigUpdateHandler;
import net.i2p.router.web.ConfigUpdateHelper;
import net.i2p.router.web.NewsHelper; import net.i2p.router.web.NewsHelper;
import net.i2p.update.*; import net.i2p.update.*;
import static net.i2p.update.UpdateType.*; import static net.i2p.update.UpdateType.*;
import static net.i2p.update.UpdateMethod.*; import static net.i2p.update.UpdateMethod.*;
import net.i2p.util.EepGet; import net.i2p.util.EepGet;
import net.i2p.util.EepHead;
import net.i2p.util.FileUtil; import net.i2p.util.FileUtil;
import net.i2p.util.Log; import net.i2p.util.Log;
import net.i2p.util.SSLEepGet; import net.i2p.util.SSLEepGet;
@ -177,7 +172,7 @@ class NewsFetcher extends UpdateRunner {
// TODO if minversion > our version, continue // TODO if minversion > our version, continue
// and look for a second entry with clearnet URLs // and look for a second entry with clearnet URLs
// TODO clearnet URLs, notify with HTTP_CLEARNET and/or HTTPS_CLEARNET // TODO clearnet URLs, notify with HTTP_CLEARNET and/or HTTPS_CLEARNET
Map<UpdateMethod, List<URI>> sourceMap = new HashMap(4); Map<UpdateMethod, List<URI>> sourceMap = new HashMap<UpdateMethod, List<URI>>(4);
// Must do su3 first // Must do su3 first
if (ConfigUpdateHandler.USE_SU3_UPDATE) { if (ConfigUpdateHandler.USE_SU3_UPDATE) {
sourceMap.put(HTTP, _mgr.getUpdateURLs(ROUTER_SIGNED_SU3, "", HTTP)); sourceMap.put(HTTP, _mgr.getUpdateURLs(ROUTER_SIGNED_SU3, "", HTTP));
@ -231,7 +226,7 @@ class NewsFetcher extends UpdateRunner {
* @since 0.9.4 * @since 0.9.4
*/ */
private static Map<String, String> parseArgs(String args) { private static Map<String, String> parseArgs(String args) {
Map<String, String> rv = new HashMap(8); Map<String, String> rv = new HashMap<String, String>(8);
char data[] = args.toCharArray(); char data[] = args.toCharArray();
StringBuilder buf = new StringBuilder(32); StringBuilder buf = new StringBuilder(32);
boolean isQuoted = false; boolean isQuoted = false;
@ -290,7 +285,7 @@ class NewsFetcher extends UpdateRunner {
private static List<URI> tokenize(String URLs) { private static List<URI> tokenize(String URLs) {
StringTokenizer tok = new StringTokenizer(URLs, " ,\r\n"); StringTokenizer tok = new StringTokenizer(URLs, " ,\r\n");
List<URI> rv = new ArrayList(); List<URI> rv = new ArrayList<URI>();
while (tok.hasMoreTokens()) { while (tok.hasMoreTokens()) {
try { try {
rv.add(new URI(tok.nextToken().trim())); rv.add(new URI(tok.nextToken().trim()));

View File

@ -38,7 +38,7 @@ class NewsHandler extends UpdateHandler implements Checker {
if ((type != ROUTER_SIGNED && type != NEWS) || if ((type != ROUTER_SIGNED && type != NEWS) ||
method != HTTP) method != HTTP)
return null; return null;
List<URI> updateSources = new ArrayList(2); List<URI> updateSources = new ArrayList<URI>(2);
try { try {
updateSources.add(new URI(ConfigUpdateHelper.getNewsURL(_context))); updateSources.add(new URI(ConfigUpdateHelper.getNewsURL(_context)));
} catch (URISyntaxException use) {} } catch (URISyntaxException use) {}

View File

@ -1,30 +1,12 @@
package net.i2p.router.update; package net.i2p.router.update;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import net.i2p.crypto.TrustedUpdate;
import net.i2p.data.DataHelper; import net.i2p.data.DataHelper;
import net.i2p.router.Router;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.RouterVersion;
import net.i2p.router.web.ConfigUpdateHandler; import net.i2p.router.web.ConfigUpdateHandler;
import net.i2p.router.web.ConfigUpdateHelper;
import net.i2p.router.web.NewsHelper; import net.i2p.router.web.NewsHelper;
import static net.i2p.update.UpdateType.*; import static net.i2p.update.UpdateType.*;
import net.i2p.util.EepGet;
import net.i2p.util.EepHead;
import net.i2p.util.FileUtil;
import net.i2p.util.I2PAppThread; import net.i2p.util.I2PAppThread;
import net.i2p.util.Log; import net.i2p.util.Log;
import net.i2p.util.SimpleScheduler;
import net.i2p.util.SimpleTimer; import net.i2p.util.SimpleTimer;
/** /**

View File

@ -1,20 +1,13 @@
package net.i2p.router.update; package net.i2p.router.update;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.net.URI; import java.net.URI;
import java.util.List; import java.util.List;
import java.util.Properties;
import net.i2p.crypto.TrustedUpdate; import net.i2p.crypto.TrustedUpdate;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.web.ConfigUpdateHandler; import net.i2p.router.web.ConfigUpdateHandler;
import net.i2p.update.*; import net.i2p.update.*;
import net.i2p.util.EepGet;
import net.i2p.util.I2PAppThread;
import net.i2p.util.PartialEepGet; import net.i2p.util.PartialEepGet;
import net.i2p.util.VersionComparator;
/** /**
* Check for an updated version of a plugin. * Check for an updated version of a plugin.

View File

@ -20,13 +20,10 @@ import net.i2p.router.web.PluginStarter;
import net.i2p.update.*; import net.i2p.update.*;
import net.i2p.util.EepGet; import net.i2p.util.EepGet;
import net.i2p.util.FileUtil; import net.i2p.util.FileUtil;
import net.i2p.util.I2PAppThread;
import net.i2p.util.Log; import net.i2p.util.Log;
import net.i2p.util.OrderedProperties; import net.i2p.util.OrderedProperties;
import net.i2p.util.SecureDirectory; import net.i2p.util.SecureDirectory;
import net.i2p.util.SecureFile; import net.i2p.util.SecureFile;
import net.i2p.util.SimpleScheduler;
import net.i2p.util.SimpleTimer;
import net.i2p.util.VersionComparator; import net.i2p.util.VersionComparator;

View File

@ -1,6 +1,5 @@
package net.i2p.router.update; package net.i2p.router.update;
import java.io.File;
import java.net.URI; import java.net.URI;
import java.util.List; import java.util.List;
@ -9,8 +8,6 @@ import net.i2p.router.util.RFC822Date;
import net.i2p.router.web.ConfigUpdateHandler; import net.i2p.router.web.ConfigUpdateHandler;
import net.i2p.update.*; import net.i2p.update.*;
import net.i2p.util.EepHead; import net.i2p.util.EepHead;
import net.i2p.util.I2PAppThread;
import net.i2p.util.Log;
/** /**
* Does a simple EepHead to get the last-modified header. * Does a simple EepHead to get the last-modified header.

View File

@ -1,6 +1,5 @@
package net.i2p.router.update; package net.i2p.router.update;
import java.io.File;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.Collections; import java.util.Collections;

View File

@ -4,15 +4,11 @@ import java.io.File;
import java.net.URI; import java.net.URI;
import java.util.List; import java.util.List;
import net.i2p.router.Router;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.util.RFC822Date; import net.i2p.router.util.RFC822Date;
import net.i2p.router.web.ConfigUpdateHandler; import net.i2p.router.web.ConfigUpdateHandler;
import net.i2p.update.*;
import static net.i2p.update.UpdateType.*; import static net.i2p.update.UpdateType.*;
import net.i2p.util.EepGet; import net.i2p.util.EepGet;
import net.i2p.util.FileUtil;
import net.i2p.util.I2PAppThread;
import net.i2p.util.Log; import net.i2p.util.Log;

View File

@ -6,10 +6,7 @@ import java.io.File;
import java.net.URI; import java.net.URI;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.StringTokenizer;
import net.i2p.crypto.TrustedUpdate; import net.i2p.crypto.TrustedUpdate;
import net.i2p.data.DataHelper;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.RouterVersion; import net.i2p.router.RouterVersion;
import net.i2p.router.web.ConfigUpdateHandler; import net.i2p.router.web.ConfigUpdateHandler;

View File

@ -40,7 +40,7 @@ public class BanlistRenderer {
StringBuilder buf = new StringBuilder(1024); StringBuilder buf = new StringBuilder(1024);
// move to the jsp // move to the jsp
//buf.append("<h2>Banned Peers</h2>"); //buf.append("<h2>Banned Peers</h2>");
Map<Hash, Banlist.Entry> entries = new TreeMap(new HashComparator()); Map<Hash, Banlist.Entry> entries = new TreeMap<Hash, Banlist.Entry>(new HashComparator());
entries.putAll(_context.banlist().getEntries()); entries.putAll(_context.banlist().getEntries());
if (entries.isEmpty()) { if (entries.isEmpty()) {
@ -64,7 +64,7 @@ public class BanlistRenderer {
buf.append(_("Temporary ban expiring in {0}", expireString)); buf.append(_("Temporary ban expiring in {0}", expireString));
else else
buf.append(_("Banned until restart or in {0}", expireString)); buf.append(_("Banned until restart or in {0}", expireString));
Set transports = entry.transports; Set<String> transports = entry.transports;
if ( (transports != null) && (!transports.isEmpty()) ) if ( (transports != null) && (!transports.isEmpty()) )
buf.append(" on the following transport: ").append(transports); buf.append(" on the following transport: ").append(transports);
if (entry.cause != null) { if (entry.cause != null) {

View File

@ -11,7 +11,7 @@ import net.i2p.util.RandomSource;
*/ */
public class CSSHelper extends HelperBase { public class CSSHelper extends HelperBase {
private static final Map<String, Boolean> _UACache = new ConcurrentHashMap(); private static final Map<String, Boolean> _UACache = new ConcurrentHashMap<String, Boolean>();
public static final String PROP_UNIVERSAL_THEMING = "routerconsole.universal.theme"; public static final String PROP_UNIVERSAL_THEMING = "routerconsole.universal.theme";
public static final String PROP_THEME_NAME = "routerconsole.theme"; public static final String PROP_THEME_NAME = "routerconsole.theme";

View File

@ -40,7 +40,7 @@ public class ConfigAdvancedHandler extends FormHandler {
* *
*/ */
private void saveChanges() { private void saveChanges() {
Set<String> unsetKeys = new HashSet(_context.router().getConfigSettings()); Set<String> unsetKeys = new HashSet<String>(_context.router().getConfigSettings());
if (_config != null) { if (_config != null) {
Properties props = new Properties(); Properties props = new Properties();
try { try {

View File

@ -9,7 +9,7 @@ public class ConfigAdvancedHelper extends HelperBase {
public String getSettings() { public String getSettings() {
StringBuilder buf = new StringBuilder(4*1024); StringBuilder buf = new StringBuilder(4*1024);
TreeMap<String, String> sorted = new TreeMap(); TreeMap<String, String> sorted = new TreeMap<String, String>();
sorted.putAll(_context.router().getConfigMap()); sorted.putAll(_context.router().getConfigMap());
for (Map.Entry<String, String> e : sorted.entrySet()) { for (Map.Entry<String, String> e : sorted.entrySet()) {
String name = e.getKey(); String name = e.getKey();

View File

@ -16,7 +16,6 @@ import net.i2p.app.ClientAppState;
import net.i2p.router.client.ClientManagerFacadeImpl; import net.i2p.router.client.ClientManagerFacadeImpl;
import net.i2p.router.startup.ClientAppConfig; import net.i2p.router.startup.ClientAppConfig;
import net.i2p.router.startup.LoadClientAppsJob; import net.i2p.router.startup.LoadClientAppsJob;
import net.i2p.router.startup.RouterAppManager;
import net.i2p.router.update.ConsoleUpdateManager; import net.i2p.router.update.ConsoleUpdateManager;
import static net.i2p.update.UpdateType.*; import static net.i2p.update.UpdateType.*;
@ -426,7 +425,7 @@ public class ConfigClientsHandler extends FormHandler {
* @since 0.8.3 * @since 0.8.3
*/ */
private void saveInterfaceChanges() { private void saveInterfaceChanges() {
Map<String, String> changes = new HashMap(); Map<String, String> changes = new HashMap<String, String>();
String port = getJettyString("port"); String port = getJettyString("port");
if (port != null) if (port != null)
changes.put(ClientManagerFacadeImpl.PROP_CLIENT_PORT, port); changes.put(ClientManagerFacadeImpl.PROP_CLIENT_PORT, port);

View File

@ -15,7 +15,6 @@ import net.i2p.data.DataHelper;
import net.i2p.router.client.ClientManagerFacadeImpl; import net.i2p.router.client.ClientManagerFacadeImpl;
import net.i2p.router.startup.ClientAppConfig; import net.i2p.router.startup.ClientAppConfig;
import net.i2p.router.startup.LoadClientAppsJob; import net.i2p.router.startup.LoadClientAppsJob;
import net.i2p.router.startup.RouterAppManager;
import net.i2p.util.Addresses; import net.i2p.util.Addresses;
public class ConfigClientsHelper extends HelperBase { public class ConfigClientsHelper extends HelperBase {
@ -58,7 +57,7 @@ public class ConfigClientsHelper extends HelperBase {
/** @since 0.8.3 */ /** @since 0.8.3 */
public String[] intfcAddresses() { public String[] intfcAddresses() {
ArrayList<String> al = new ArrayList(Addresses.getAllAddresses()); ArrayList<String> al = new ArrayList<String>(Addresses.getAllAddresses());
return al.toArray(new String[al.size()]); return al.toArray(new String[al.size()]);
} }

View File

@ -81,7 +81,7 @@ public class ConfigHomeHandler extends FormHandler {
addFormNotice(_("Added") + ": " + app.name); addFormNotice(_("Added") + ": " + app.name);
} else { } else {
// deleting // deleting
Set<String> toDelete = new HashSet(); Set<String> toDelete = new HashSet<String>();
for (Object o : _settings.keySet()) { for (Object o : _settings.keySet()) {
if (!(o instanceof String)) if (!(o instanceof String))
continue; continue;

View File

@ -32,7 +32,7 @@ public class ConfigLoggingHelper extends HelperBase {
public String getLogLevelTable() { public String getLogLevelTable() {
StringBuilder buf = new StringBuilder(32*1024); StringBuilder buf = new StringBuilder(32*1024);
Properties limits = _context.logManager().getLimits(); Properties limits = _context.logManager().getLimits();
TreeSet<String> sortedLogs = new TreeSet(); TreeSet<String> sortedLogs = new TreeSet<String>();
for (Iterator iter = limits.keySet().iterator(); iter.hasNext(); ) { for (Iterator iter = limits.keySet().iterator(); iter.hasNext(); ) {
String prefix = (String)iter.next(); String prefix = (String)iter.next();
sortedLogs.add(prefix); sortedLogs.add(prefix);
@ -98,7 +98,7 @@ public class ConfigLoggingHelper extends HelperBase {
public String getNewClassBox() { public String getNewClassBox() {
List<Log> logs = _context.logManager().getLogs(); List<Log> logs = _context.logManager().getLogs();
Set limits = _context.logManager().getLimits().keySet(); Set limits = _context.logManager().getLimits().keySet();
TreeSet<String> sortedLogs = new TreeSet(); TreeSet<String> sortedLogs = new TreeSet<String>();
for (Log log : logs) { for (Log log : logs) {
String name = log.getName(); String name = log.getName();

View File

@ -50,7 +50,7 @@ public class ConfigNetHandler extends FormHandler {
private boolean _ratesOnly; private boolean _ratesOnly;
private boolean _udpDisabled; private boolean _udpDisabled;
private String _ipv6Mode; private String _ipv6Mode;
private final Map<String, String> changes = new HashMap(); private final Map<String, String> changes = new HashMap<String, String>();
private static final String PROP_HIDDEN = Router.PROP_HIDDEN_HIDDEN; // see Router for other choice private static final String PROP_HIDDEN = Router.PROP_HIDDEN_HIDDEN; // see Router for other choice
@Override @Override
@ -150,7 +150,7 @@ public class ConfigNetHandler extends FormHandler {
private void saveChanges() { private void saveChanges() {
boolean restartRequired = false; boolean restartRequired = false;
boolean error = false; boolean error = false;
List<String> removes = new ArrayList(); List<String> removes = new ArrayList<String>();
if (!_ratesOnly) { if (!_ratesOnly) {
// IP Settings // IP Settings
@ -162,7 +162,7 @@ public class ConfigNetHandler extends FormHandler {
if (_udpAutoIP.equals("fixed")) { if (_udpAutoIP.equals("fixed")) {
if (_settings == null) if (_settings == null)
_settings = Collections.EMPTY_MAP; _settings = Collections.EMPTY_MAP;
Set<String> addrs = new TreeSet(); Set<String> addrs = new TreeSet<String>();
for (Object o : _settings.keySet()) { for (Object o : _settings.keySet()) {
String k = (String) o; String k = (String) o;
if (k.startsWith("addr_")) { if (k.startsWith("addr_")) {

View File

@ -1,6 +1,5 @@
package net.i2p.router.web; package net.i2p.router.web;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
@ -189,9 +188,9 @@ public class ConfigNetHelper extends HelperBase {
Set<String> configs; Set<String> configs;
String cs = getUdphostname(); String cs = getUdphostname();
if (cs.length() <= 0) { if (cs.length() <= 0) {
configs = Collections.EMPTY_SET; configs = Collections.emptySet();
} else { } else {
configs = new HashSet(4); configs = new HashSet<String>(4);
String[] ca = cs.split("[,; \r\n\t]"); String[] ca = cs.split("[,; \r\n\t]");
for (int i = 0; i < ca.length; i++) { for (int i = 0; i < ca.length; i++) {
String c = ca[i]; String c = ca[i];

View File

@ -11,8 +11,8 @@ import net.i2p.router.networkdb.reseed.Reseeder;
* @since 0.8.3 * @since 0.8.3
*/ */
public class ConfigReseedHandler extends FormHandler { public class ConfigReseedHandler extends FormHandler {
private final Map<String, String> changes = new HashMap(); private final Map<String, String> changes = new HashMap<String, String>();
private final List<String> removes = new ArrayList(); private final List<String> removes = new ArrayList<String>();
@Override @Override
protected void processForm() { protected void processForm() {

View File

@ -89,7 +89,7 @@ public class ConfigReseedHelper extends HelperBase {
public String getReseedURL() { public String getReseedURL() {
String urls = _context.getProperty(Reseeder.PROP_RESEED_URL, Reseeder.DEFAULT_SEED_URL + ',' + Reseeder.DEFAULT_SSL_SEED_URL); String urls = _context.getProperty(Reseeder.PROP_RESEED_URL, Reseeder.DEFAULT_SEED_URL + ',' + Reseeder.DEFAULT_SSL_SEED_URL);
StringTokenizer tok = new StringTokenizer(urls, " ,\r\n"); StringTokenizer tok = new StringTokenizer(urls, " ,\r\n");
List<String> URLList = new ArrayList(16); List<String> URLList = new ArrayList<String>(16);
while (tok.hasMoreTokens()) { while (tok.hasMoreTokens()) {
String s = tok.nextToken().trim(); String s = tok.nextToken().trim();
if (s.length() > 0) if (s.length() > 0)

View File

@ -246,10 +246,10 @@ public class ConfigServiceHandler extends FormHandler {
} }
private void browseOnStartup(boolean shouldLaunchBrowser) { private void browseOnStartup(boolean shouldLaunchBrowser) {
List clients = ClientAppConfig.getClientApps(_context); List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context);
boolean found = false; boolean found = false;
for (int cur = 0; cur < clients.size(); cur++) { for (int cur = 0; cur < clients.size(); cur++) {
ClientAppConfig ca = (ClientAppConfig) clients.get(cur); ClientAppConfig ca = clients.get(cur);
if (UrlLauncher.class.getName().equals(ca.className)) { if (UrlLauncher.class.getName().equals(ca.className)) {
ca.disabled = !shouldLaunchBrowser; ca.disabled = !shouldLaunchBrowser;
found = true; found = true;

View File

@ -15,7 +15,7 @@ import net.i2p.stat.StatManager;
*/ */
public class ConfigStatsHandler extends FormHandler { public class ConfigStatsHandler extends FormHandler {
private String _filename; private String _filename;
private List _stats; private List<String> _stats;
private String _graphs; private String _graphs;
private boolean _explicitFilter; private boolean _explicitFilter;
private String _explicitFilterValue; private String _explicitFilterValue;
@ -23,7 +23,7 @@ public class ConfigStatsHandler extends FormHandler {
public ConfigStatsHandler() { public ConfigStatsHandler() {
super(); super();
_stats = new ArrayList(); _stats = new ArrayList<String>();
_graphs = ""; _graphs = "";
_explicitFilter = false; _explicitFilter = false;
_isFull = false; _isFull = false;
@ -75,7 +75,7 @@ public class ConfigStatsHandler extends FormHandler {
* *
*/ */
private void saveChanges() { private void saveChanges() {
Map<String, String> changes = new HashMap(); Map<String, String> changes = new HashMap<String, String>();
if (_filename == null) if (_filename == null)
_filename = StatManager.DEFAULT_STAT_FILE; _filename = StatManager.DEFAULT_STAT_FILE;
changes.put(StatManager.PROP_STAT_FILE, _filename); changes.put(StatManager.PROP_STAT_FILE, _filename);

View File

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.text.Collator; import java.text.Collator;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -37,9 +36,9 @@ public class ConfigStatsHelper extends HelperBase {
private boolean _currentCanBeGraphed; private boolean _currentCanBeGraphed;
public ConfigStatsHelper() { public ConfigStatsHelper() {
_stats = new ArrayList(); _stats = new ArrayList<String>();
_filters = new HashSet(); _filters = new HashSet<String>();
_graphs = new HashSet(); _graphs = new HashSet<String>();
} }
/** /**
@ -54,7 +53,7 @@ public class ConfigStatsHelper extends HelperBase {
_log = _context.logManager().getLog(ConfigStatsHelper.class); _log = _context.logManager().getLog(ConfigStatsHelper.class);
Map<String, SortedSet<String>> unsorted = _context.statManager().getStatsByGroup(); Map<String, SortedSet<String>> unsorted = _context.statManager().getStatsByGroup();
Map<String, Set<String>> groups = new TreeMap(new AlphaComparator()); Map<String, Set<String>> groups = new TreeMap<String, Set<String>>(new AlphaComparator());
groups.putAll(unsorted); groups.putAll(unsorted);
for (Set<String> stats : groups.values()) { for (Set<String> stats : groups.values()) {
_stats.addAll(stats); _stats.addAll(stats);

View File

@ -1,6 +1,5 @@
package net.i2p.router.web; package net.i2p.router.web;
import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
@ -85,7 +84,7 @@ public class ConfigSummaryHandler extends FormHandler {
return; return;
} }
} else if (deleting) { } else if (deleting) {
Set<Integer> toDelete = new HashSet(); Set<Integer> toDelete = new HashSet<Integer>();
for (Object o : _settings.keySet()) { for (Object o : _settings.keySet()) {
if (!(o instanceof String)) if (!(o instanceof String))
continue; continue;

View File

@ -37,8 +37,8 @@ public class ConfigUIHandler extends FormHandler {
private void saveChanges() { private void saveChanges() {
if (_config == null) if (_config == null)
return; return;
Map<String, String> changes = new HashMap(); Map<String, String> changes = new HashMap<String, String>();
List<String> removes = new ArrayList(); List<String> removes = new ArrayList<String>();
String oldTheme = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME); String oldTheme = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME);
boolean oldForceMobileConsole = _context.getBooleanProperty(CSSHelper.PROP_FORCE_MOBILE_CONSOLE); boolean oldForceMobileConsole = _context.getBooleanProperty(CSSHelper.PROP_FORCE_MOBILE_CONSOLE);
if (_config.equals("default")) // obsolete if (_config.equals("default")) // obsolete

View File

@ -44,7 +44,7 @@ public class ConfigUIHelper extends HelperBase {
/** @return standard and user-installed themes, sorted (untranslated) */ /** @return standard and user-installed themes, sorted (untranslated) */
private Set<String> themeSet() { private Set<String> themeSet() {
Set<String> rv = new TreeSet(); Set<String> rv = new TreeSet<String>();
// add a failsafe even if we can't find any themes // add a failsafe even if we can't find any themes
rv.add(CSSHelper.DEFAULT_THEME); rv.add(CSSHelper.DEFAULT_THEME);
File dir = new File(_context.getBaseDir(), "docs/themes/console"); File dir = new File(_context.getBaseDir(), "docs/themes/console");
@ -57,9 +57,9 @@ public class ConfigUIHelper extends HelperBase {
rv.add(name); rv.add(name);
} }
// user themes // user themes
Set props = _context.getPropertyNames(); Set<String> props = _context.getPropertyNames();
for (Iterator iter = props.iterator(); iter.hasNext(); ) { for (Iterator<String> iter = props.iterator(); iter.hasNext(); ) {
String prop = (String) iter.next(); String prop = iter.next();
if (prop.startsWith(PROP_THEME_PFX) && prop.length() > PROP_THEME_PFX.length()) if (prop.startsWith(PROP_THEME_PFX) && prop.length() > PROP_THEME_PFX.length())
rv.add(prop.substring(PROP_THEME_PFX.length())); rv.add(prop.substring(PROP_THEME_PFX.length()));
} }

View File

@ -166,7 +166,7 @@ public class ConfigUpdateHandler extends FormHandler {
return; return;
} }
Map<String, String> changes = new HashMap(); Map<String, String> changes = new HashMap<String, String>();
if ( (_newsURL != null) && (_newsURL.length() > 0) ) { if ( (_newsURL != null) && (_newsURL.length() > 0) ) {
if (_newsURL.startsWith("https")) if (_newsURL.startsWith("https"))

View File

@ -79,7 +79,7 @@ public class ConsolePasswordManager extends RouterPasswordManager {
*/ */
public Map<String, String> getMD5(String realm) { public Map<String, String> getMD5(String realm) {
String pfx = realm + '.'; String pfx = realm + '.';
Map<String, String> rv = new HashMap(4); Map<String, String> rv = new HashMap<String, String>(4);
for (Map.Entry<String, String> e : _context.router().getConfigMap().entrySet()) { for (Map.Entry<String, String> e : _context.router().getConfigMap().entrySet()) {
String prop = e.getKey(); String prop = e.getKey();
if (prop.startsWith(pfx) && prop.endsWith(PROP_MD5)) { if (prop.startsWith(pfx) && prop.endsWith(PROP_MD5)) {
@ -105,14 +105,14 @@ public class ConsolePasswordManager extends RouterPasswordManager {
// consolePassword // consolePassword
String pw = _context.getProperty(PROP_CONSOLE_OLD); String pw = _context.getProperty(PROP_CONSOLE_OLD);
if (pw != null) { if (pw != null) {
Map toAdd = new HashMap(2); Map<String, String> toAdd = new HashMap<String, String>(2);
if (pw.length() > 0) { if (pw.length() > 0) {
saveMD5(RouterConsoleRunner.PROP_CONSOLE_PW, RouterConsoleRunner.JETTY_REALM, saveMD5(RouterConsoleRunner.PROP_CONSOLE_PW, RouterConsoleRunner.JETTY_REALM,
CONSOLE_USER, pw); CONSOLE_USER, pw);
toAdd.put(RouterConsoleRunner.PROP_PW_ENABLE, "true"); toAdd.put(RouterConsoleRunner.PROP_PW_ENABLE, "true");
} }
toAdd.put(PROP_MIGRATED, "true"); toAdd.put(PROP_MIGRATED, "true");
List toDel = Collections.singletonList(PROP_CONSOLE_OLD); List<String> toDel = Collections.singletonList(PROP_CONSOLE_OLD);
return _context.router().saveConfig(toAdd, toDel); return _context.router().saveConfig(toAdd, toDel);
} }
return true; return true;
@ -164,7 +164,7 @@ public class ConsolePasswordManager extends RouterPasswordManager {
if (hex == null) if (hex == null)
return false; return false;
Map<String, String> toAdd = Collections.singletonMap(pfx + PROP_MD5, hex); Map<String, String> toAdd = Collections.singletonMap(pfx + PROP_MD5, hex);
List<String> toDel = new ArrayList(4); List<String> toDel = new ArrayList<String>(4);
toDel.add(pfx + PROP_PW); toDel.add(pfx + PROP_PW);
toDel.add(pfx + PROP_B64); toDel.add(pfx + PROP_B64);
toDel.add(pfx + PROP_CRYPT); toDel.add(pfx + PROP_CRYPT);

View File

@ -35,7 +35,7 @@ public class FileDumpHelper extends HelperBase {
// jars added in wrapper.config // jars added in wrapper.config
URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader(); URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
URL[] urls = urlClassLoader.getURLs(); URL[] urls = urlClassLoader.getURLs();
List<File> flist = new ArrayList(); List<File> flist = new ArrayList<File>();
for (int i = 0; i < urls.length; i++) { for (int i = 0; i < urls.length; i++) {
String p = urls[i].toString(); String p = urls[i].toString();
if (p.startsWith("file:") && p.endsWith(".jar")) { if (p.startsWith("file:") && p.endsWith(".jar")) {

View File

@ -30,8 +30,8 @@ public abstract class FormHandler {
private boolean _valid; private boolean _valid;
public FormHandler() { public FormHandler() {
_errors = new ArrayList(); _errors = new ArrayList<String>();
_notices = new ArrayList(); _notices = new ArrayList<String>();
_valid = true; _valid = true;
} }

View File

@ -137,15 +137,15 @@ public class GraphHelper extends FormHandler {
if (StatSummarizer.isDisabled()) if (StatSummarizer.isDisabled())
return ""; return "";
try { try {
List listeners = StatSummarizer.instance().getListeners(); List<SummaryListener> listeners = StatSummarizer.instance().getListeners();
TreeSet ordered = new TreeSet(new AlphaComparator()); TreeSet<SummaryListener> ordered = new TreeSet<SummaryListener>(new AlphaComparator());
ordered.addAll(listeners); ordered.addAll(listeners);
// go to some trouble to see if we have the data for the combined bw graph // go to some trouble to see if we have the data for the combined bw graph
boolean hasTx = false; boolean hasTx = false;
boolean hasRx = false; boolean hasRx = false;
for (Iterator iter = ordered.iterator(); iter.hasNext(); ) { for (Iterator<SummaryListener> iter = ordered.iterator(); iter.hasNext(); ) {
SummaryListener lsnr = (SummaryListener)iter.next(); SummaryListener lsnr = iter.next();
String title = lsnr.getRate().getRateStat().getName(); String title = lsnr.getRate().getRateStat().getName();
if (title.equals("bw.sendRate")) hasTx = true; if (title.equals("bw.sendRate")) hasTx = true;
else if (title.equals("bw.recvRate")) hasRx = true; else if (title.equals("bw.recvRate")) hasRx = true;
@ -166,8 +166,8 @@ public class GraphHelper extends FormHandler {
+ "\" alt=\"" + title + "\" title=\"" + title + "\"></a>\n"); + "\" alt=\"" + title + "\" title=\"" + title + "\"></a>\n");
} }
for (Iterator iter = ordered.iterator(); iter.hasNext(); ) { for (Iterator<SummaryListener> iter = ordered.iterator(); iter.hasNext(); ) {
SummaryListener lsnr = (SummaryListener)iter.next(); SummaryListener lsnr = iter.next();
Rate r = lsnr.getRate(); Rate r = lsnr.getRate();
// e.g. "statname for 60m" // e.g. "statname for 60m"
String title = _("{0} for {1}", r.getRateStat().getName(), DataHelper.formatDuration2(_periodCount * r.getPeriod())); String title = _("{0} for {1}", r.getRateStat().getName(), DataHelper.formatDuration2(_periodCount * r.getPeriod()));
@ -430,7 +430,7 @@ public class GraphHelper extends FormHandler {
_refreshDelaySeconds != _context.getProperty(PROP_REFRESH, DEFAULT_REFRESH) || _refreshDelaySeconds != _context.getProperty(PROP_REFRESH, DEFAULT_REFRESH) ||
_showEvents != _context.getBooleanProperty(PROP_EVENTS) || _showEvents != _context.getBooleanProperty(PROP_EVENTS) ||
_persistent != _context.getBooleanPropertyDefaultTrue(SummaryListener.PROP_PERSISTENT)) { _persistent != _context.getBooleanPropertyDefaultTrue(SummaryListener.PROP_PERSISTENT)) {
Map<String, String> changes = new HashMap(); Map<String, String> changes = new HashMap<String, String>();
changes.put(PROP_X, "" + _width); changes.put(PROP_X, "" + _width);
changes.put(PROP_Y, "" + _height); changes.put(PROP_Y, "" + _height);
changes.put(PROP_PERIODS, "" + _periodCount); changes.put(PROP_PERIODS, "" + _periodCount);

View File

@ -127,7 +127,7 @@ public class HomeHelper extends HelperBase {
static Collection<App> buildApps(RouterContext ctx, String config) { static Collection<App> buildApps(RouterContext ctx, String config) {
String[] args = config.split("" + S); String[] args = config.split("" + S);
Set<App> apps = new TreeSet(new AppComparator()); Set<App> apps = new TreeSet<App>(new AppComparator());
for (int i = 0; i < args.length - 3; i += 4) { for (int i = 0; i < args.length - 3; i += 4) {
String name = Messages.getString(args[i], ctx); String name = Messages.getString(args[i], ctx);
String desc = Messages.getString(args[i+1], ctx); String desc = Messages.getString(args[i+1], ctx);
@ -140,7 +140,7 @@ public class HomeHelper extends HelperBase {
static Collection<App> buildSearchApps(String config) { static Collection<App> buildSearchApps(String config) {
String[] args = config.split("" + S); String[] args = config.split("" + S);
Set<App> apps = new TreeSet(new AppComparator()); Set<App> apps = new TreeSet<App>(new AppComparator());
for (int i = 0; i < args.length - 1; i += 2) { for (int i = 0; i < args.length - 1; i += 2) {
String name = args[i]; String name = args[i];
String url = args[i+1]; String url = args[i+1];

View File

@ -39,10 +39,10 @@ public class JobQueueHelper extends HelperBase {
* @since 0.8.9 * @since 0.8.9
*/ */
private void renderStatusHTML(Writer out) throws IOException { private void renderStatusHTML(Writer out) throws IOException {
List<Job> readyJobs = new ArrayList(8); List<Job> readyJobs = new ArrayList<Job>(8);
List<Job> timedJobs = new ArrayList(128); List<Job> timedJobs = new ArrayList<Job>(128);
List<Job> activeJobs = new ArrayList(8); List<Job> activeJobs = new ArrayList<Job>(8);
List<Job> justFinishedJobs = new ArrayList(8); List<Job> justFinishedJobs = new ArrayList<Job>(8);
int numRunners = _context.jobQueue().getJobs(readyJobs, timedJobs, activeJobs, justFinishedJobs); int numRunners = _context.jobQueue().getJobs(readyJobs, timedJobs, activeJobs, justFinishedJobs);
@ -70,7 +70,7 @@ public class JobQueueHelper extends HelperBase {
buf.append("</ol>\n"); buf.append("</ol>\n");
buf.append("<hr><b>").append(_("Ready/waiting jobs")).append(": ").append(readyJobs.size()).append("</b><ol>\n"); buf.append("<hr><b>").append(_("Ready/waiting jobs")).append(": ").append(readyJobs.size()).append("</b><ol>\n");
ObjectCounter<String> counter = new ObjectCounter(); ObjectCounter<String> counter = new ObjectCounter<String>();
for (int i = 0; i < readyJobs.size(); i++) { for (int i = 0; i < readyJobs.size(); i++) {
Job j = readyJobs.get(i); Job j = readyJobs.get(i);
counter.increment(j.getName()); counter.increment(j.getName());
@ -117,7 +117,7 @@ public class JobQueueHelper extends HelperBase {
/** @since 0.9.5 */ /** @since 0.9.5 */
private void getJobCounts(StringBuilder buf, ObjectCounter<String> counter) { private void getJobCounts(StringBuilder buf, ObjectCounter<String> counter) {
List<String> names = new ArrayList(counter.objects()); List<String> names = new ArrayList<String>(counter.objects());
if (names.size() < 4) if (names.size() < 4)
return; return;
buf.append("<table style=\"width: 30%; margin-left: 100px;\">\n" + buf.append("<table style=\"width: 30%; margin-left: 100px;\">\n" +
@ -153,7 +153,7 @@ public class JobQueueHelper extends HelperBase {
long maxPendingTime = -1; long maxPendingTime = -1;
long minPendingTime = -1; long minPendingTime = -1;
List<JobStats> tstats = new ArrayList(_context.jobQueue().getJobStats()); List<JobStats> tstats = new ArrayList<JobStats>(_context.jobQueue().getJobStats());
Collections.sort(tstats, new JobStatsComparator()); Collections.sort(tstats, new JobStatsComparator());
for (JobStats stats : tstats) { for (JobStats stats : tstats) {

View File

@ -7,10 +7,11 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import net.i2p.I2PAppContext; import net.i2p.I2PAppContext;
import net.i2p.router.web.HomeHelper.App;
public class NavHelper { public class NavHelper {
private static Map<String, String> _apps = new ConcurrentHashMap(4); private static Map<String, String> _apps = new ConcurrentHashMap<String, String>(4);
private static Map<String, String> _tooltips = new ConcurrentHashMap(4); private static Map<String, String> _tooltips = new ConcurrentHashMap<String, String>(4);
/** /**
* To register a new client application so that it shows up on the router * To register a new client application so that it shows up on the router
@ -42,7 +43,7 @@ public class NavHelper {
if (_apps.isEmpty()) if (_apps.isEmpty())
return ""; return "";
StringBuilder buf = new StringBuilder(256); StringBuilder buf = new StringBuilder(256);
List<String> l = new ArrayList(_apps.keySet()); List<String> l = new ArrayList<String>(_apps.keySet());
Collections.sort(l); Collections.sort(l);
for (String name : l) { for (String name : l) {
String path = _apps.get(name); String path = _apps.get(name);
@ -65,8 +66,8 @@ public class NavHelper {
*/ */
static List<HomeHelper.App> getClientApps(I2PAppContext ctx) { static List<HomeHelper.App> getClientApps(I2PAppContext ctx) {
if (_apps.isEmpty()) if (_apps.isEmpty())
return Collections.EMPTY_LIST; return Collections.emptyList();
List<HomeHelper.App> rv = new ArrayList(_apps.size()); List<HomeHelper.App> rv = new ArrayList<App>(_apps.size());
for (Map.Entry<String, String> e : _apps.entrySet()) { for (Map.Entry<String, String> e : _apps.entrySet()) {
String name = e.getKey(); String name = e.getKey();
String path = e.getValue(); String path = e.getValue();

View File

@ -1,9 +1,6 @@
package net.i2p.router.web; package net.i2p.router.web;
import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStreamWriter;
import net.i2p.data.DataHelper; import net.i2p.data.DataHelper;
public class NetDbHelper extends HelperBase { public class NetDbHelper extends HelperBase {

View File

@ -108,11 +108,11 @@ public class NetDbRenderer {
DecimalFormat fmt; DecimalFormat fmt;
if (debug) { if (debug) {
ourRKey = _context.routerHash(); ourRKey = _context.routerHash();
leases = new TreeSet(new LeaseSetRoutingKeyComparator(ourRKey)); leases = new TreeSet<LeaseSet>(new LeaseSetRoutingKeyComparator(ourRKey));
fmt = new DecimalFormat("#0.00"); fmt = new DecimalFormat("#0.00");
} else { } else {
ourRKey = null; ourRKey = null;
leases = new TreeSet(new LeaseSetComparator()); leases = new TreeSet<LeaseSet>(new LeaseSetComparator());
fmt = null; fmt = null;
} }
leases.addAll(_context.netDb().getLeases()); leases.addAll(_context.netDb().getLeases());
@ -257,11 +257,11 @@ public class NetDbRenderer {
buf.setLength(0); buf.setLength(0);
} }
ObjectCounter<String> versions = new ObjectCounter(); ObjectCounter<String> versions = new ObjectCounter<String>();
ObjectCounter<String> countries = new ObjectCounter(); ObjectCounter<String> countries = new ObjectCounter<String>();
int[] transportCount = new int[TNAMES.length]; int[] transportCount = new int[TNAMES.length];
Set<RouterInfo> routers = new TreeSet(new RouterInfoComparator()); Set<RouterInfo> routers = new TreeSet<RouterInfo>(new RouterInfoComparator());
routers.addAll(_context.netDb().getRouters()); routers.addAll(_context.netDb().getRouters());
for (RouterInfo ri : routers) { for (RouterInfo ri : routers) {
Hash key = ri.getIdentity().getHash(); Hash key = ri.getIdentity().getHash();
@ -292,7 +292,7 @@ public class NetDbRenderer {
.append(_("Network Database Router Statistics")) .append(_("Network Database Router Statistics"))
.append("</th></tr><tr><td style=\"vertical-align: top;\">"); .append("</th></tr><tr><td style=\"vertical-align: top;\">");
// versions table // versions table
List<String> versionList = new ArrayList(versions.objects()); List<String> versionList = new ArrayList<String>(versions.objects());
if (!versionList.isEmpty()) { if (!versionList.isEmpty()) {
Collections.sort(versionList, Collections.reverseOrder(new VersionComparator())); Collections.sort(versionList, Collections.reverseOrder(new VersionComparator()));
buf.append("<table>\n"); buf.append("<table>\n");
@ -324,7 +324,7 @@ public class NetDbRenderer {
buf.setLength(0); buf.setLength(0);
// country table // country table
List<String> countryList = new ArrayList(countries.objects()); List<String> countryList = new ArrayList<String>(countries.objects());
if (!countryList.isEmpty()) { if (!countryList.isEmpty()) {
Collections.sort(countryList, new CountryComparator()); Collections.sort(countryList, new CountryComparator());
buf.append("<table>\n"); buf.append("<table>\n");

View File

@ -57,7 +57,7 @@ public class PluginStarter implements Runnable {
private static Map<String, ThreadGroup> pluginThreadGroups = new ConcurrentHashMap<String, ThreadGroup>(); // one thread group per plugin (map key=plugin name) private static Map<String, ThreadGroup> pluginThreadGroups = new ConcurrentHashMap<String, ThreadGroup>(); // one thread group per plugin (map key=plugin name)
private static Map<String, Collection<SimpleTimer2.TimedEvent>> _pendingPluginClients = private static Map<String, Collection<SimpleTimer2.TimedEvent>> _pendingPluginClients =
new ConcurrentHashMap<String, Collection<SimpleTimer2.TimedEvent>>(); new ConcurrentHashMap<String, Collection<SimpleTimer2.TimedEvent>>();
private static Map<String, ClassLoader> _clCache = new ConcurrentHashMap(); private static Map<String, ClassLoader> _clCache = new ConcurrentHashMap<String, ClassLoader>();
private static Map<String, Collection<String>> pluginWars = new ConcurrentHashMap<String, Collection<String>>(); private static Map<String, Collection<String>> pluginWars = new ConcurrentHashMap<String, Collection<String>>();
public PluginStarter(RouterContext ctx) { public PluginStarter(RouterContext ctx) {
@ -111,7 +111,7 @@ public class PluginStarter implements Runnable {
*/ */
private static void updateAll(RouterContext ctx, boolean delay) { private static void updateAll(RouterContext ctx, boolean delay) {
List<String> plugins = getPlugins(); List<String> plugins = getPlugins();
Map<String, String> toUpdate = new HashMap(); Map<String, String> toUpdate = new HashMap<String, String>();
for (String appName : plugins) { for (String appName : plugins) {
Properties props = pluginProperties(ctx, appName); Properties props = pluginProperties(ctx, appName);
String url = props.getProperty("updateURL"); String url = props.getProperty("updateURL");
@ -458,8 +458,8 @@ public class PluginStarter implements Runnable {
File[] tfiles = dir.listFiles(); File[] tfiles = dir.listFiles();
if (tfiles != null) { if (tfiles != null) {
String current = ctx.getProperty(CSSHelper.PROP_THEME_NAME); String current = ctx.getProperty(CSSHelper.PROP_THEME_NAME);
Map<String, String> changes = new HashMap(); Map<String, String> changes = new HashMap<String, String>();
List<String> removes = new ArrayList(); List<String> removes = new ArrayList<String>();
for (int i = 0; i < tfiles.length; i++) { for (int i = 0; i < tfiles.length; i++) {
String name = tfiles[i].getName(); String name = tfiles[i].getName();
if (tfiles[i].isDirectory() && (!Arrays.asList(STANDARD_THEMES).contains(tfiles[i]))) { if (tfiles[i].isDirectory() && (!Arrays.asList(STANDARD_THEMES).contains(tfiles[i]))) {
@ -544,7 +544,7 @@ public class PluginStarter implements Runnable {
* all installed plugins whether enabled or not * all installed plugins whether enabled or not
*/ */
public static List<String> getPlugins() { public static List<String> getPlugins() {
List<String> rv = new ArrayList(); List<String> rv = new ArrayList<String>();
File pluginDir = new File(I2PAppContext.getGlobalContext().getConfigDir(), PLUGIN_DIR); File pluginDir = new File(I2PAppContext.getGlobalContext().getConfigDir(), PLUGIN_DIR);
File[] files = pluginDir.listFiles(); File[] files = pluginDir.listFiles();
if (files == null) if (files == null)
@ -563,7 +563,7 @@ public class PluginStarter implements Runnable {
* Last one wins if a dup (installer should prevent dups) * Last one wins if a dup (installer should prevent dups)
*/ */
public static Map<String, String> getPluginKeys(I2PAppContext ctx) { public static Map<String, String> getPluginKeys(I2PAppContext ctx) {
Map<String, String> rv = new HashMap(); Map<String, String> rv = new HashMap<String, String>();
List<String> names = getPlugins(); List<String> names = getPlugins();
for (String name : names) { for (String name : names) {
Properties props = pluginProperties(ctx, name); Properties props = pluginProperties(ctx, name);
@ -806,7 +806,7 @@ public class PluginStarter implements Runnable {
*/ */
private static URL[] classpathToURLArray(String classpath, String clientName, Log log) { private static URL[] classpathToURLArray(String classpath, String clientName, Log log) {
StringTokenizer tok = new StringTokenizer(classpath, ","); StringTokenizer tok = new StringTokenizer(classpath, ",");
List<URL> urls = new ArrayList(); List<URL> urls = new ArrayList<URL>();
while (tok.hasMoreTokens()) { while (tok.hasMoreTokens()) {
String elem = tok.nextToken().trim(); String elem = tok.nextToken().trim();
File f = new File(elem); File f = new File(elem);

View File

@ -42,7 +42,7 @@ class ProfileOrganizerRenderer {
long now = _context.clock().now(); long now = _context.clock().now();
long hideBefore = now - 90*60*1000; long hideBefore = now - 90*60*1000;
Set<PeerProfile> order = new TreeSet(mode == 2 ? new HashComparator() : new ProfileComparator()); Set<PeerProfile> order = new TreeSet<PeerProfile>(mode == 2 ? new HashComparator() : new ProfileComparator());
int older = 0; int older = 0;
int standard = 0; int standard = 0;
for (Iterator<Hash> iter = peers.iterator(); iter.hasNext();) { for (Iterator<Hash> iter = peers.iterator(); iter.hasNext();) {

View File

@ -1,7 +1,6 @@
package net.i2p.router.web; package net.i2p.router.web;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.networkdb.reseed.Reseeder;
/** /**
* Handler to deal with reseed requests. * Handler to deal with reseed requests.

View File

@ -9,12 +9,11 @@ import java.net.InetAddress;
import java.net.Inet4Address; import java.net.Inet4Address;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.ServerSocket; import java.net.ServerSocket;
import java.security.KeyStore;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.Set; import java.util.SortedSet;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.SynchronousQueue; import java.util.concurrent.SynchronousQueue;
@ -28,7 +27,6 @@ import net.i2p.app.ClientAppState;
import static net.i2p.app.ClientAppState.*; import static net.i2p.app.ClientAppState.*;
import net.i2p.apps.systray.SysTray; import net.i2p.apps.systray.SysTray;
import net.i2p.crypto.KeyStoreUtil; import net.i2p.crypto.KeyStoreUtil;
import net.i2p.data.Base32;
import net.i2p.data.DataHelper; import net.i2p.data.DataHelper;
import net.i2p.jetty.I2PLogger; import net.i2p.jetty.I2PLogger;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
@ -40,12 +38,9 @@ import net.i2p.util.I2PAppThread;
import net.i2p.util.PortMapper; import net.i2p.util.PortMapper;
import net.i2p.util.SecureDirectory; import net.i2p.util.SecureDirectory;
import net.i2p.util.SystemVersion; import net.i2p.util.SystemVersion;
import net.i2p.util.VersionComparator;
import org.eclipse.jetty.security.HashLoginService; import org.eclipse.jetty.security.HashLoginService;
import org.eclipse.jetty.security.ConstraintMapping; import org.eclipse.jetty.security.ConstraintMapping;
import org.eclipse.jetty.security.ConstraintSecurityHandler; import org.eclipse.jetty.security.ConstraintSecurityHandler;
import org.eclipse.jetty.security.SecurityHandler;
import org.eclipse.jetty.security.authentication.DigestAuthenticator; import org.eclipse.jetty.security.authentication.DigestAuthenticator;
import org.eclipse.jetty.server.AbstractConnector; import org.eclipse.jetty.server.AbstractConnector;
import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Connector;
@ -378,10 +373,10 @@ public class RouterConsoleRunner implements RouterApp {
HandlerWrapper rootWebApp = null; HandlerWrapper rootWebApp = null;
ServletHandler rootServletHandler = null; ServletHandler rootServletHandler = null;
List<Connector> connectors = new ArrayList(4); List<Connector> connectors = new ArrayList<Connector>(4);
try { try {
int boundAddresses = 0; int boundAddresses = 0;
Set addresses = Addresses.getAllAddresses(); SortedSet<String> addresses = Addresses.getAllAddresses();
boolean hasIPV4 = addresses.contains("0.0.0.0"); boolean hasIPV4 = addresses.contains("0.0.0.0");
boolean hasIPV6 = addresses.contains("0:0:0:0:0:0:0:0"); boolean hasIPV6 = addresses.contains("0:0:0:0:0:0:0:0");
@ -587,7 +582,7 @@ public class RouterConsoleRunner implements RouterApp {
// so things start faster. // so things start faster.
// Jetty 6 starts the connector before the router console is ready // Jetty 6 starts the connector before the router console is ready
// This also prevents one webapp from breaking the whole thing // This also prevents one webapp from breaking the whole thing
List<String> notStarted = new ArrayList(); List<String> notStarted = new ArrayList<String>();
if (_server.isRunning()) { if (_server.isRunning()) {
File dir = new File(_webAppsDir); File dir = new File(_webAppsDir);
String fileNames[] = dir.list(WarFilenameFilter.instance()); String fileNames[] = dir.list(WarFilenameFilter.instance());
@ -698,7 +693,7 @@ public class RouterConsoleRunner implements RouterApp {
success = ks.exists(); success = ks.exists();
if (success) { if (success) {
try { try {
Map<String, String> changes = new HashMap(); Map<String, String> changes = new HashMap<String, String>();
changes.put(PROP_KEYSTORE_PASSWORD, DEFAULT_KEYSTORE_PASSWORD); changes.put(PROP_KEYSTORE_PASSWORD, DEFAULT_KEYSTORE_PASSWORD);
changes.put(PROP_KEY_PASSWORD, keyPassword); changes.put(PROP_KEY_PASSWORD, keyPassword);
_context.router().saveConfig(changes, null); _context.router().saveConfig(changes, null);
@ -724,7 +719,7 @@ public class RouterConsoleRunner implements RouterApp {
*/ */
static void initialize(RouterContext ctx, WebAppContext context) { static void initialize(RouterContext ctx, WebAppContext context) {
ConstraintSecurityHandler sec = new ConstraintSecurityHandler(); ConstraintSecurityHandler sec = new ConstraintSecurityHandler();
List<ConstraintMapping> constraints = new ArrayList(4); List<ConstraintMapping> constraints = new ArrayList<ConstraintMapping>(4);
ConsolePasswordManager mgr = new ConsolePasswordManager(ctx); ConsolePasswordManager mgr = new ConsolePasswordManager(ctx);
boolean enable = ctx.getBooleanProperty(PROP_PW_ENABLE); boolean enable = ctx.getBooleanProperty(PROP_PW_ENABLE);
if (enable) { if (enable) {
@ -842,7 +837,7 @@ public class RouterConsoleRunner implements RouterApp {
public CustomThreadPoolExecutor() { public CustomThreadPoolExecutor() {
super(new ThreadPoolExecutor( super(new ThreadPoolExecutor(
MIN_THREADS, MAX_THREADS, MAX_IDLE_TIME, TimeUnit.MILLISECONDS, MIN_THREADS, MAX_THREADS, MAX_IDLE_TIME, TimeUnit.MILLISECONDS,
new SynchronousQueue(), new SynchronousQueue<Runnable>(),
new CustomThreadFactory(), new CustomThreadFactory(),
new ThreadPoolExecutor.CallerRunsPolicy()) new ThreadPoolExecutor.CallerRunsPolicy())
); );

View File

@ -14,7 +14,7 @@ public class SearchHelper extends HelperBase {
private String _engine; private String _engine;
private String _query; private String _query;
private Map<String, String> _engines = new TreeMap(); private Map<String, String> _engines = new TreeMap<String, String>();
private static final char S = ','; private static final char S = ',';
// in case engines need to know where it came from // in case engines need to know where it came from

View File

@ -46,7 +46,7 @@ public class StatSummarizer implements Runnable {
public StatSummarizer() { public StatSummarizer() {
_context = RouterContext.listContexts().get(0); // only summarize one per jvm _context = RouterContext.listContexts().get(0); // only summarize one per jvm
_log = _context.logManager().getLog(getClass()); _log = _context.logManager().getLog(getClass());
_listeners = new CopyOnWriteArrayList(); _listeners = new CopyOnWriteArrayList<SummaryListener>();
_instance = this; _instance = this;
_sem = new Semaphore(MAX_CONCURRENT_PNG, true); _sem = new Semaphore(MAX_CONCURRENT_PNG, true);
_context.addShutdownTask(new Shutdown()); _context.addShutdownTask(new Shutdown());
@ -311,9 +311,9 @@ public class StatSummarizer implements Runnable {
*/ */
Set<Rate> parseSpecs(String specs) { Set<Rate> parseSpecs(String specs) {
if (specs == null) if (specs == null)
return Collections.EMPTY_SET; return Collections.emptySet();
StringTokenizer tok = new StringTokenizer(specs, ","); StringTokenizer tok = new StringTokenizer(specs, ",");
Set<Rate> rv = new HashSet(); Set<Rate> rv = new HashSet<Rate>();
while (tok.hasMoreTokens()) { while (tok.hasMoreTokens()) {
String spec = tok.nextToken(); String spec = tok.nextToken();
int split = spec.lastIndexOf('.'); int split = spec.lastIndexOf('.');

View File

@ -6,7 +6,6 @@ import java.text.DecimalFormat;
import java.text.Collator; import java.text.Collator;
import java.util.Arrays; import java.util.Arrays;
import java.util.Comparator; import java.util.Comparator;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.SortedSet; import java.util.SortedSet;
@ -37,7 +36,7 @@ public class StatsGenerator {
buf.setLength(0); buf.setLength(0);
Map<String, SortedSet<String>> unsorted = _context.statManager().getStatsByGroup(); Map<String, SortedSet<String>> unsorted = _context.statManager().getStatsByGroup();
Map<String, Set<String>> groups = new TreeMap(new AlphaComparator()); Map<String, Set<String>> groups = new TreeMap<String, Set<String>>(new AlphaComparator());
groups.putAll(unsorted); groups.putAll(unsorted);
for (String group : groups.keySet()) { for (String group : groups.keySet()) {
buf.append("<option value=\"#").append(group).append("\">"); buf.append("<option value=\"#").append(group).append("\">");

View File

@ -409,7 +409,7 @@ public class SummaryHelper extends HelperBase {
*/ */
public String getDestinations() { public String getDestinations() {
// convert the set to a list so we can sort by name and not lose duplicates // convert the set to a list so we can sort by name and not lose duplicates
List<Destination> clients = new ArrayList(_context.clientManager().listClients()); List<Destination> clients = new ArrayList<Destination>(_context.clientManager().listClients());
StringBuilder buf = new StringBuilder(512); StringBuilder buf = new StringBuilder(512);
buf.append("<h3><a href=\"/i2ptunnelmgr\" target=\"_top\" title=\"").append(_("Add/remove/edit &amp; control your client and server tunnels")).append("\">").append(_("Local Destinations")).append("</a></h3><hr class=\"b\"><div class=\"tunnels\">"); buf.append("<h3><a href=\"/i2ptunnelmgr\" target=\"_top\" title=\"").append(_("Add/remove/edit &amp; control your client and server tunnels")).append("\">").append(_("Local Destinations")).append("</a></h3><hr class=\"b\"><div class=\"tunnels\">");
@ -837,7 +837,7 @@ public class SummaryHelper extends HelperBase {
String[] allSections = SummaryBarRenderer.ALL_SECTIONS; String[] allSections = SummaryBarRenderer.ALL_SECTIONS;
Map<String, String> sectionNames = SummaryBarRenderer.SECTION_NAMES; Map<String, String> sectionNames = SummaryBarRenderer.SECTION_NAMES;
List<String> sections = getSummaryBarSections("default"); List<String> sections = getSummaryBarSections("default");
TreeSet<String> sortedSections = new TreeSet(); TreeSet<String> sortedSections = new TreeSet<String>();
for (int i = 0; i < allSections.length; i++) { for (int i = 0; i < allSections.length; i++) {
String section = allSections[i]; String section = allSections[i];

View File

@ -23,7 +23,6 @@ import net.i2p.util.SystemVersion;
import org.jrobin.core.RrdException; import org.jrobin.core.RrdException;
import org.jrobin.graph.RrdGraph; import org.jrobin.graph.RrdGraph;
import org.jrobin.graph.RrdGraphDef; import org.jrobin.graph.RrdGraphDef;
import org.jrobin.graph.RrdGraphDefTemplate;
/** /**
* Generate the RRD graph png images, * Generate the RRD graph png images,

View File

@ -38,7 +38,7 @@ public class TunnelRenderer {
List<Hash> destinations = null; List<Hash> destinations = null;
Map<Hash, TunnelPool> clientInboundPools = _context.tunnelManager().getInboundClientPools(); Map<Hash, TunnelPool> clientInboundPools = _context.tunnelManager().getInboundClientPools();
Map<Hash, TunnelPool> clientOutboundPools = _context.tunnelManager().getOutboundClientPools(); Map<Hash, TunnelPool> clientOutboundPools = _context.tunnelManager().getOutboundClientPools();
destinations = new ArrayList(clientInboundPools.keySet()); destinations = new ArrayList<Hash>(clientInboundPools.keySet());
boolean debug = _context.getBooleanProperty(HelperBase.PROP_ADVANCED); boolean debug = _context.getBooleanProperty(HelperBase.PROP_ADVANCED);
for (int i = 0; i < destinations.size(); i++) { for (int i = 0; i < destinations.size(); i++) {
Hash client = destinations.get(i); Hash client = destinations.get(i);
@ -64,7 +64,7 @@ public class TunnelRenderer {
renderPool(out, in, outPool); renderPool(out, in, outPool);
} }
List participating = _context.tunnelDispatcher().listParticipatingTunnels(); List<HopConfig> participating = _context.tunnelDispatcher().listParticipatingTunnels();
Collections.sort(participating, new TunnelComparator()); Collections.sort(participating, new TunnelComparator());
out.write("<h2><a name=\"participating\"></a>" + _("Participating tunnels") + "</h2><table>\n"); out.write("<h2><a name=\"participating\"></a>" + _("Participating tunnels") + "</h2><table>\n");
out.write("<tr><th>" + _("Receive on") + "</th><th>" + _("From") + "</th><th>" out.write("<tr><th>" + _("Receive on") + "</th><th>" + _("From") + "</th><th>"
@ -142,7 +142,7 @@ public class TunnelRenderer {
private void renderPool(Writer out, TunnelPool in, TunnelPool outPool) throws IOException { private void renderPool(Writer out, TunnelPool in, TunnelPool outPool) throws IOException {
List<TunnelInfo> tunnels = null; List<TunnelInfo> tunnels = null;
if (in == null) if (in == null)
tunnels = new ArrayList(); tunnels = new ArrayList<TunnelInfo>();
else else
tunnels = in.listTunnels(); tunnels = in.listTunnels();
if (outPool != null) if (outPool != null)

View File

@ -68,7 +68,7 @@ public class WebAppConfiguration implements Configuration {
// WebAppContext doesn't provide a remove method, so we must // WebAppContext doesn't provide a remove method, so we must
// convert to a list, remove the wildcard entry, add ours, then // convert to a list, remove the wildcard entry, add ours, then
// add the wildcard back, then reset. // add the wildcard back, then reset.
List<String> classes = new ArrayList(16); List<String> classes = new ArrayList<String>(16);
classes.addAll(Arrays.asList(wac.getServerClasses())); classes.addAll(Arrays.asList(wac.getServerClasses()));
classes.remove("org.eclipse.jetty."); classes.remove("org.eclipse.jetty.");
classes.add("-org.eclipse.jetty.http."); classes.add("-org.eclipse.jetty.http.");
@ -152,7 +152,7 @@ public class WebAppConfiguration implements Configuration {
private static Set<URL> getSystemClassPath() { private static Set<URL> getSystemClassPath() {
URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader(); URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
URL urls[] = urlClassLoader.getURLs(); URL urls[] = urlClassLoader.getURLs();
Set<URL> rv = new HashSet(32); Set<URL> rv = new HashSet<URL>(32);
for (int i = 0; i < urls.length; i++) { for (int i = 0; i < urls.length; i++) {
rv.add(urls[i]); rv.add(urls[i]);
} }

View File

@ -34,7 +34,7 @@ import org.eclipse.jetty.webapp.WebAppContext;
*/ */
public class WebAppStarter { public class WebAppStarter {
private static final Map<String, Long> warModTimes = new ConcurrentHashMap(); private static final Map<String, Long> warModTimes = new ConcurrentHashMap<String, Long>();
static final Map INIT_PARAMS = new HashMap(4); static final Map INIT_PARAMS = new HashMap(4);
//static private Log _log; //static private Log _log;