From 57ddc8ea4f80b2f7adfd8f4e35920eed8379650b Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Sat, 25 Aug 2018 14:29:32 +0000 Subject: [PATCH] conversion cleanup --- .../net/i2p/i2ptunnel/ui/TunnelConfig.java | 8 ++++---- .../src/net/i2p/i2ptunnel/web/EditBean.java | 2 +- .../i2p/client/streaming/I2PSocketEepGet.java | 4 ++-- .../streaming/I2PSocketManagerFactory.java | 2 +- .../src/net/i2p/router/web/CSSHelper.java | 6 +++--- .../i2p/router/web/ConfigUpdateHandler.java | 4 ++-- .../web/helpers/ConfigClientsHandler.java | 4 ++-- .../web/helpers/ConfigClientsHelper.java | 7 ++++--- .../router/web/helpers/ConfigHomeHandler.java | 2 +- .../router/web/helpers/ConfigNetHandler.java | 20 +++++++++---------- .../web/helpers/ConfigStatsHandler.java | 2 +- .../web/helpers/ConfigSummaryHandler.java | 2 +- .../i2p/router/web/helpers/GraphHelper.java | 14 ++++++------- .../src/i2p/susi/dns/AddressbookBean.java | 4 ++-- .../src/src/i2p/susi/webmail/WebMail.java | 10 +++++----- .../i2p/client/impl/I2CPMessageProducer.java | 5 +++-- core/java/src/net/i2p/util/EepGet.java | 4 ++-- .../src/net/i2p/router/RouterContext.java | 2 +- .../net/i2p/router/TunnelPoolSettings.java | 14 ++++++------- .../router/transport/udp/UDPTransport.java | 4 ++-- 20 files changed, 61 insertions(+), 59 deletions(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/TunnelConfig.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/TunnelConfig.java index 2de8051714..bfeccaba14 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/TunnelConfig.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/TunnelConfig.java @@ -604,7 +604,7 @@ public class TunnelConfig { if (TunnelController.TYPE_HTTP_CLIENT.equals(_type)) _booleanOptions.add(I2PTunnelHTTPClient.PROP_SSL_SET); for (String p : _booleanClientOpts) - config.setProperty(OPT + p, "" + _booleanOptions.contains(p)); + config.setProperty(OPT + p, Boolean.toString(_booleanOptions.contains(p))); for (String p : _otherClientOpts) { if (_otherOptions.containsKey(p)) config.setProperty(OPT + p, _otherOptions.get(p)); @@ -616,7 +616,7 @@ public class TunnelConfig { // see TunnelController.setConfig() _booleanOptions.add(TunnelController.PROP_LIMITS_SET); for (String p : _booleanServerOpts) - config.setProperty(OPT + p, "" + _booleanOptions.contains(p)); + config.setProperty(OPT + p, Boolean.toString(_booleanOptions.contains(p))); for (String p : _otherServerOpts) { if (_otherOptions.containsKey(p)) config.setProperty(OPT + p, _otherOptions.get(p)); @@ -634,7 +634,7 @@ public class TunnelConfig { if (TunnelController.TYPE_HTTP_CLIENT.equals(_type) || TunnelController.TYPE_CONNECT.equals(_type) || TunnelController.TYPE_SOCKS.equals(_type) ||TunnelController.TYPE_SOCKS_IRC.equals(_type)) { for (String p : _booleanProxyOpts) - config.setProperty(OPT + p, "" + _booleanOptions.contains(p)); + config.setProperty(OPT + p, Boolean.toString(_booleanOptions.contains(p))); if (_proxyList != null) config.setProperty(TunnelController.PROP_PROXIES, _proxyList); } @@ -705,7 +705,7 @@ public class TunnelConfig { if (TunnelController.TYPE_IRC_CLIENT.equals(_type)) { boolean dcc = _booleanOptions.contains(I2PTunnelIRCClient.PROP_DCC); config.setProperty(OPT + I2PTunnelIRCClient.PROP_DCC, - "" + dcc); + Boolean.toString(dcc)); // add some sane server options since they aren't in the GUI (yet) if (dcc) { config.setProperty(OPT + PROP_MAX_CONNS_MIN, "3"); 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 bacd84aea8..d89f05b379 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java @@ -61,7 +61,7 @@ public class EditBean extends IndexBean { public String getTargetPort(int tunnel) { int port = _helper.getTargetPort(tunnel); - return port > 0 ? "" + port : ""; + return port > 0 ? Integer.toString(port) : ""; } public String getPrivateKeyFile(int tunnel) { diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketEepGet.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketEepGet.java index 5b1badb184..3be6a8c321 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketEepGet.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketEepGet.java @@ -169,8 +169,8 @@ public class I2PSocketEepGet extends EepGet { // This currently duplicates what SocketTimeout is doing in EepGet, // but when that's ripped out of EepGet to use setsotimeout, we'll need this. Properties props = new Properties(); - props.setProperty(I2PSocketOptions.PROP_CONNECT_TIMEOUT, "" + CONNECT_TIMEOUT); - props.setProperty(I2PSocketOptions.PROP_READ_TIMEOUT, "" + INACTIVITY_TIMEOUT); + props.setProperty(I2PSocketOptions.PROP_CONNECT_TIMEOUT, Integer.toString(CONNECT_TIMEOUT)); + props.setProperty(I2PSocketOptions.PROP_READ_TIMEOUT, Integer.toString(INACTIVITY_TIMEOUT)); // This is important - even if the underlying socket doesn't have a connect delay, // we want to set it for this connection, so the request headers will go out // in the SYN packet, saving one RTT. diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java index 3490f18e3c..9893f4cfa7 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java @@ -240,7 +240,7 @@ public class I2PSocketManagerFactory { if (i2cpHost != null) opts.setProperty(I2PClient.PROP_TCP_HOST, i2cpHost); if (i2cpPort > 0) - opts.setProperty(I2PClient.PROP_TCP_PORT, "" + i2cpPort); + opts.setProperty(I2PClient.PROP_TCP_PORT, Integer.toString(i2cpPort)); I2PSession session = client.createSession(myPrivateKeyStream, opts); if (connect) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java index f1301fa9f4..7db23b10df 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java @@ -130,7 +130,7 @@ public class CSSHelper extends HelperBase { public void setRefresh(String r) { try { if (Integer.parseInt(r) < MIN_REFRESH) - r = "" + MIN_REFRESH; + r = Integer.toString(MIN_REFRESH); _context.router().saveConfig(PROP_REFRESH, r); } catch (RuntimeException e) { } @@ -141,9 +141,9 @@ public class CSSHelper extends HelperBase { String r = _context.getProperty(PROP_REFRESH, DEFAULT_REFRESH); try { if (Integer.parseInt(r) < MIN_REFRESH) - r = "" + MIN_REFRESH; + r = Integer.toString(MIN_REFRESH); } catch (RuntimeException e) { - r = "" + MIN_REFRESH; + r = Integer.toString(MIN_REFRESH); } return r; } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java index 6d222ed34a..85b043104c 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java @@ -55,7 +55,7 @@ public class ConfigUpdateHandler extends FormHandler { public static final String DEFAULT_PROXY_HOST = "127.0.0.1"; public static final String PROP_PROXY_PORT = "router.updateProxyPort"; public static final int DEFAULT_PROXY_PORT_INT = 4444; - public static final String DEFAULT_PROXY_PORT = "" + DEFAULT_PROXY_PORT_INT; + public static final String DEFAULT_PROXY_PORT = Integer.toString(DEFAULT_PROXY_PORT_INT); /** default false */ public static final String PROP_UPDATE_UNSIGNED = "router.updateUnsigned"; /** default false - use for distros */ @@ -251,7 +251,7 @@ public class ConfigUpdateHandler extends FormHandler { long oldFreq = DEFAULT_REFRESH_FREQ; try { oldFreq = Long.parseLong(oldFreqStr); } catch (NumberFormatException nfe) {} if (_refreshFrequency != oldFreq) { - changes.put(PROP_REFRESH_FREQUENCY, ""+_refreshFrequency); + changes.put(PROP_REFRESH_FREQUENCY, Long.toString(_refreshFrequency)); addFormNoticeNoEscape(_t("Updating refresh frequency to {0}", _refreshFrequency <= 0 ? _t("Never") : DataHelper.formatDuration2(_refreshFrequency))); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHandler.java index 5ae27bb867..798c96066d 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHandler.java @@ -361,7 +361,7 @@ public class ConfigClientsHandler extends FormHandler { String app = name.substring(RouterConsoleRunner.PREFIX.length(), name.lastIndexOf(RouterConsoleRunner.ENABLED)); Object val = _settings.get(app + ".enabled"); if (! RouterConsoleRunner.ROUTERCONSOLE.equals(app)) - props.setProperty(name, "" + (val != null)); + props.setProperty(name, Boolean.toString(val != null)); } RouterConsoleRunner.storeWebAppProperties(_context, props); addFormNotice(_t("WebApp configuration saved.")); @@ -375,7 +375,7 @@ public class ConfigClientsHandler extends FormHandler { continue; String app = name.substring(PluginStarter.PREFIX.length(), name.lastIndexOf(PluginStarter.ENABLED)); Object val = _settings.get(app + ".enabled"); - props.setProperty(name, "" + (val != null)); + props.setProperty(name, Boolean.toString(val != null)); } PluginStarter.storePluginProperties(props); addFormNotice(_t("Plugin configuration saved.")); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHelper.java index 2b70a422e7..7be834986f 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHelper.java @@ -148,7 +148,8 @@ public class ConfigClientsHelper extends HelperBase { showStart = clientApp == null; showStop = clientApp != null && clientApp.getState() == ClientAppState.RUNNING; } - renderForm(buf, ""+cur, ca.clientName, + String scur = Integer.toString(cur); + renderForm(buf, scur, ca.clientName, // urlify, enabled false, !ca.disabled, // read only, preventDisable @@ -158,7 +159,7 @@ public class ConfigClientsHelper extends HelperBase { // description DataHelper.escapeHTML(ca.className + ((ca.args != null) ? " " + ca.args : "")), // edit - allowEdit && (""+cur).equals(_edit), + allowEdit && scur.equals(_edit), // show edit button, show update button // Don't allow edit if it's running, or else we would lose the "handle" to the ClientApp to stop it. allowEdit && !showStop, false, @@ -169,7 +170,7 @@ public class ConfigClientsHelper extends HelperBase { } if (allowEdit && "new".equals(_edit)) - renderForm(buf, "" + clients.size(), "", false, false, false, false, "", true, false, false, false, false, false); + renderForm(buf, Integer.toString(clients.size()), "", false, false, false, false, "", true, false, false, false, false, false); buf.append("</table>\n"); return buf.toString(); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigHomeHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigHomeHandler.java index a653f057b2..3a71f11ea3 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigHomeHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigHomeHandler.java @@ -27,7 +27,7 @@ public class ConfigHomeHandler extends FormHandler { boolean old = _context.getBooleanProperty(HomeHelper.PROP_OLDHOME); boolean nnew = getJettyString("oldHome") != null; if (old != nnew) { - _context.router().saveConfig(HomeHelper.PROP_OLDHOME, "" + nnew); + _context.router().saveConfig(HomeHelper.PROP_OLDHOME, Boolean.toString(nnew)); addFormNotice(_t("Home page changed")); } } else if (adding || deleting || restoring) { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHandler.java index 17b5d46022..91d0616686 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHandler.java @@ -282,7 +282,7 @@ public class ConfigNetHandler extends FormHandler { } if (valid) { changes.put(ConfigNetHelper.PROP_I2NP_NTCP_AUTO_IP, _ntcpAutoIP); - changes.put(TransportManager.PROP_ENABLE_NTCP, "" + !"disabled".equals(_ntcpAutoIP)); + changes.put(TransportManager.PROP_ENABLE_NTCP, Boolean.toString(!"disabled".equals(_ntcpAutoIP))); restartRequired = true; } } @@ -304,7 +304,7 @@ public class ConfigNetHandler extends FormHandler { removes.add(ConfigNetHelper.PROP_I2NP_NTCP_PORT); addFormNotice(_t("Updating inbound TCP port to auto")); } - changes.put(ConfigNetHelper.PROP_I2NP_NTCP_AUTO_PORT, "" + _ntcpAutoPort); + changes.put(ConfigNetHelper.PROP_I2NP_NTCP_AUTO_PORT, Boolean.toString(_ntcpAutoPort)); restartRequired = true; } @@ -339,15 +339,15 @@ public class ConfigNetHandler extends FormHandler { // If hidden mode value changes, restart is required switchRequired = _hiddenMode != _context.router().isHidden(); if (switchRequired) { - changes.put(PROP_HIDDEN, "" + _hiddenMode); + changes.put(PROP_HIDDEN, Boolean.toString(_hiddenMode)); if (_hiddenMode) addFormError(_t("Gracefully restarting into Hidden Router Mode")); else addFormError(_t("Gracefully restarting to exit Hidden Router Mode")); } - changes.put(Router.PROP_REBUILD_KEYS, "" + switchRequired); - changes.put(Router.PROP_DYNAMIC_KEYS, "" + _dynamicKeys); + changes.put(Router.PROP_REBUILD_KEYS, Boolean.toString(switchRequired)); + changes.put(Router.PROP_DYNAMIC_KEYS, Boolean.toString(_dynamicKeys)); if (_context.getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_UPNP) != _upnp) { @@ -358,7 +358,7 @@ public class ConfigNetHandler extends FormHandler { addFormNotice(_t("Disabling UPnP")); addFormNotice(_t("Restart required to take effect")); } - changes.put(TransportManager.PROP_ENABLE_UPNP, "" + _upnp); + changes.put(TransportManager.PROP_ENABLE_UPNP, Boolean.toString(_upnp)); if (Boolean.parseBoolean(_context.getProperty(UDPTransport.PROP_LAPTOP_MODE)) != _laptop) { @@ -368,7 +368,7 @@ public class ConfigNetHandler extends FormHandler { else addFormNotice(_t("Disabling laptop mode")); } - changes.put(UDPTransport.PROP_LAPTOP_MODE, "" + _laptop); + changes.put(UDPTransport.PROP_LAPTOP_MODE, Boolean.toString(_laptop)); if (Boolean.parseBoolean(_context.getProperty(TransportUtil.PROP_IPV4_FIREWALLED)) != _ipv4Firewalled) { @@ -378,7 +378,7 @@ public class ConfigNetHandler extends FormHandler { addFormNotice(_t("Enabling inbound IPv4")); restartRequired = true; } - changes.put(TransportUtil.PROP_IPV4_FIREWALLED, "" + _ipv4Firewalled); + changes.put(TransportUtil.PROP_IPV4_FIREWALLED, Boolean.toString(_ipv4Firewalled)); if (Boolean.parseBoolean(_context.getProperty(TransportUtil.PROP_IPV6_FIREWALLED)) != _ipv6Firewalled) { @@ -388,7 +388,7 @@ public class ConfigNetHandler extends FormHandler { addFormNotice(_t("Enabling inbound IPv6")); restartRequired = true; } - changes.put(TransportUtil.PROP_IPV6_FIREWALLED, "" + _ipv6Firewalled); + changes.put(TransportUtil.PROP_IPV6_FIREWALLED, Boolean.toString(_ipv6Firewalled)); if (_context.getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_UDP) != !_udpDisabled) { @@ -398,7 +398,7 @@ public class ConfigNetHandler extends FormHandler { addFormNotice(_t("Enabling UDP")); restartRequired = true; } - changes.put(TransportManager.PROP_ENABLE_UDP, "" + (!_udpDisabled)); + changes.put(TransportManager.PROP_ENABLE_UDP, Boolean.toString(!_udpDisabled)); if (_requireIntroductions) { changes.put(UDPTransport.PROP_FORCE_INTRODUCERS, "true"); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigStatsHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigStatsHandler.java index 61cdd6e035..a77ea07d4f 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigStatsHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigStatsHandler.java @@ -113,7 +113,7 @@ public class ConfigStatsHandler extends FormHandler { boolean graphsChanged = !_graphs.equals(_context.getProperty("stat.summaries")); changes.put("stat.summaries", _graphs); boolean fullChanged = _context.getBooleanProperty(StatManager.PROP_STAT_FULL) != _isFull; - changes.put(StatManager.PROP_STAT_FULL, "" + _isFull); + changes.put(StatManager.PROP_STAT_FULL, Boolean.toString(_isFull)); _context.router().saveConfig(changes, null); if (!_stats.isEmpty()) addFormNotice(_t("Stat filter and location updated successfully to") + ": " + stats.toString()); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigSummaryHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigSummaryHandler.java index fdffba4209..49eb9f1574 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigSummaryHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigSummaryHandler.java @@ -30,7 +30,7 @@ public class ConfigSummaryHandler extends FormHandler { try { int refreshInterval = Integer.parseInt(getJettyString("refreshInterval")); if (refreshInterval >= CSSHelper.MIN_REFRESH) { - _context.router().saveConfig(CSSHelper.PROP_REFRESH, "" + refreshInterval); + _context.router().saveConfig(CSSHelper.PROP_REFRESH, Integer.toString(refreshInterval)); addFormNotice(_t("Refresh interval changed")); } else addFormError(_t("Refresh interval must be at least {0} seconds", CSSHelper.MIN_REFRESH)); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/GraphHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/GraphHelper.java index e0222b20dc..c7867a4f6d 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/GraphHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/GraphHelper.java @@ -477,13 +477,13 @@ public class GraphHelper extends FormHandler { _graphHideLegend != _context.getProperty(PROP_LEGEND, DEFAULT_LEGEND) || _persistent != _context.getBooleanPropertyDefaultTrue(SummaryListener.PROP_PERSISTENT)) { Map<String, String> changes = new HashMap<String, String>(); - changes.put(PROP_X, "" + _width); - changes.put(PROP_Y, "" + _height); - changes.put(PROP_PERIODS, "" + _periodCount); - changes.put(PROP_REFRESH, "" + _refreshDelaySeconds); - changes.put(PROP_EVENTS, "" + _showEvents); - changes.put(PROP_LEGEND, "" + _graphHideLegend); - changes.put(SummaryListener.PROP_PERSISTENT, "" + _persistent); + changes.put(PROP_X, Integer.toString(_width)); + changes.put(PROP_Y, Integer.toString(_height)); + changes.put(PROP_PERIODS, Integer.toString(_periodCount)); + changes.put(PROP_REFRESH, Integer.toString(_refreshDelaySeconds)); + changes.put(PROP_EVENTS, Boolean.toString(_showEvents)); + changes.put(PROP_LEGEND, Boolean.toString(_graphHideLegend)); + changes.put(SummaryListener.PROP_PERSISTENT, Boolean.toString(_persistent)); _context.router().saveConfig(changes, null); addFormNotice(_t("Graph settings saved")); } diff --git a/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java b/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java index 483cc47b6f..91301d9f47 100644 --- a/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java +++ b/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java @@ -433,7 +433,7 @@ public class AddressbookBean extends BaseBean } public String getBegin() { - return "" + getBeginInt(); + return Integer.toString(getBeginInt()); } /** @@ -455,7 +455,7 @@ public class AddressbookBean extends BaseBean } public String getEnd() { - return "" + getEndInt(); + return Integer.toString(getEndInt()); } /** diff --git a/apps/susimail/src/src/i2p/susi/webmail/WebMail.java b/apps/susimail/src/src/i2p/susi/webmail/WebMail.java index d5a41dfd7b..6eb509bf2a 100644 --- a/apps/susimail/src/src/i2p/susi/webmail/WebMail.java +++ b/apps/susimail/src/src/i2p/susi/webmail/WebMail.java @@ -693,8 +693,8 @@ public class WebMail extends HttpServlet boolean fixedPorts = Boolean.parseBoolean(Config.getProperty( CONFIG_PORTS_FIXED, "true" )); if (fixedPorts) { host = Config.getProperty( CONFIG_HOST, DEFAULT_HOST ); - pop3Port = Config.getProperty( CONFIG_PORTS_POP3, "" + DEFAULT_POP3PORT ); - smtpPort = Config.getProperty( CONFIG_PORTS_SMTP, "" + DEFAULT_SMTPPORT ); + pop3Port = Config.getProperty(CONFIG_PORTS_POP3, Integer.toString(DEFAULT_POP3PORT)); + smtpPort = Config.getProperty(CONFIG_PORTS_SMTP, Integer.toString(DEFAULT_SMTPPORT)); } boolean doContinue = true; @@ -3068,9 +3068,9 @@ public class WebMail extends HttpServlet private static void showLogin( PrintWriter out ) { boolean fixed = Boolean.parseBoolean(Config.getProperty( CONFIG_PORTS_FIXED, "true" )); - String host = Config.getProperty( CONFIG_HOST, DEFAULT_HOST ); - String pop3 = Config.getProperty( CONFIG_PORTS_POP3, "" + DEFAULT_POP3PORT ); - String smtp = Config.getProperty( CONFIG_PORTS_SMTP, "" + DEFAULT_SMTPPORT ); + String host = Config.getProperty(CONFIG_HOST, DEFAULT_HOST); + String pop3 = Config.getProperty(CONFIG_PORTS_POP3, Integer.toString(DEFAULT_POP3PORT)); + String smtp = Config.getProperty(CONFIG_PORTS_SMTP, Integer.toString(DEFAULT_SMTPPORT)); out.println( "<div id=\"dologin\"><h1>" + _t("Email Login") + "</h1><table cellspacing=\"3\" cellpadding=\"5\">\n" + // current postman hq length limits 16/12, new postman version 32/32 diff --git a/core/java/src/net/i2p/client/impl/I2CPMessageProducer.java b/core/java/src/net/i2p/client/impl/I2CPMessageProducer.java index dd6783f433..75e6b1ebae 100644 --- a/core/java/src/net/i2p/client/impl/I2CPMessageProducer.java +++ b/core/java/src/net/i2p/client/impl/I2CPMessageProducer.java @@ -387,8 +387,9 @@ class I2CPMessageProducer { Properties newprops = new Properties(); newprops.putAll(props); props = newprops; - props.setProperty("inbound.quantity", "" + tunnels); - props.setProperty("outbound.quantity", "" + tunnels); + String stunnels = Integer.toString(tunnels); + props.setProperty("inbound.quantity", stunnels); + props.setProperty("outbound.quantity", stunnels); props.setProperty("inbound.backupQuantity", "0"); props.setProperty("outbound.backupQuantity", "0"); } diff --git a/core/java/src/net/i2p/util/EepGet.java b/core/java/src/net/i2p/util/EepGet.java index 4ad10934d1..830e11fbe4 100644 --- a/core/java/src/net/i2p/util/EepGet.java +++ b/core/java/src/net/i2p/util/EepGet.java @@ -557,7 +557,7 @@ public class EepGet { System.out.println("** " + new Date()); System.out.println("** Attempt " + currentAttempt + " of " + url + " failed"); System.out.println("** Transfered " + bytesTransferred - + " with " + (bytesRemaining < 0 ? "unknown" : ""+bytesRemaining) + " remaining"); + + " with " + (bytesRemaining < 0 ? "unknown" : Long.toString(bytesRemaining)) + " remaining"); System.out.println("** " + cause.getMessage()); _previousWritten += _written; _written = 0; @@ -566,7 +566,7 @@ public class EepGet { System.out.println("== " + new Date()); System.out.println("== Transfer of " + url + " failed after " + currentAttempt + " attempts"); System.out.println("== Transfer size: " + bytesTransferred + " with " - + (bytesRemaining < 0 ? "unknown" : ""+bytesRemaining) + " remaining"); + + (bytesRemaining < 0 ? "unknown" : Long.toString(bytesRemaining)) + " remaining"); long timeToSend = _context.clock().now() - _startedOn; System.out.println("== Transfer time: " + DataHelper.formatDuration(timeToSend)); double kbps = (timeToSend > 0 ? (1000.0d*(bytesTransferred)/(timeToSend*1024.0d)) : 0); diff --git a/router/java/src/net/i2p/router/RouterContext.java b/router/java/src/net/i2p/router/RouterContext.java index eb94d3fe49..47766551e3 100644 --- a/router/java/src/net/i2p/router/RouterContext.java +++ b/router/java/src/net/i2p/router/RouterContext.java @@ -152,7 +152,7 @@ public class RouterContext extends I2PAppContext { long maxMemory = SystemVersion.getMaxMemory(); long maxBuffs = (SystemVersion.isAndroid() || SystemVersion.isARM()) ? 4 : 8; long buffs = Math.min(maxBuffs, Math.max(2, maxMemory / (21 * 1024 * 1024))); - envProps.setProperty("prng.buffers", "" + buffs); + envProps.setProperty("prng.buffers", Long.toString(buffs)); } return envProps; } diff --git a/router/java/src/net/i2p/router/TunnelPoolSettings.java b/router/java/src/net/i2p/router/TunnelPoolSettings.java index 2c781ed092..2c8a197b6e 100644 --- a/router/java/src/net/i2p/router/TunnelPoolSettings.java +++ b/router/java/src/net/i2p/router/TunnelPoolSettings.java @@ -337,16 +337,16 @@ public class TunnelPoolSettings { */ public void writeToProperties(String prefix, Properties props) { if (props == null) return; - props.setProperty(prefix + PROP_ALLOW_ZERO_HOP, ""+_allowZeroHop); - props.setProperty(prefix + PROP_BACKUP_QUANTITY, ""+_backupQuantity); + props.setProperty(prefix + PROP_ALLOW_ZERO_HOP, Boolean.toString(_allowZeroHop)); + props.setProperty(prefix + PROP_BACKUP_QUANTITY, Integer.toString(_backupQuantity)); //props.setProperty(prefix + PROP_DURATION, ""+_duration); - props.setProperty(prefix + PROP_LENGTH, ""+_length); - props.setProperty(prefix + PROP_LENGTH_VARIANCE, ""+_lengthVariance); + props.setProperty(prefix + PROP_LENGTH, Integer.toString(_length)); + props.setProperty(prefix + PROP_LENGTH_VARIANCE, Integer.toString(_lengthVariance)); if (_destinationNickname != null) - props.setProperty(prefix + PROP_NICKNAME, ""+_destinationNickname); - props.setProperty(prefix + PROP_QUANTITY, ""+_quantity); + props.setProperty(prefix + PROP_NICKNAME, _destinationNickname); + props.setProperty(prefix + PROP_QUANTITY, Integer.toString(_quantity)); // props.setProperty(prefix + PROP_REBUILD_PERIOD, ""+_rebuildPeriod); - props.setProperty(prefix + PROP_IP_RESTRICTION, ""+_IPRestriction); + props.setProperty(prefix + PROP_IP_RESTRICTION, Integer.toString(_IPRestriction)); if (!_isInbound) props.setProperty(prefix + PROP_PRIORITY, Integer.toString(_priority)); for (Map.Entry<Object, Object> e : _unknownOptions.entrySet()) { diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java index fde8d92d26..7f1c55ceec 100644 --- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java +++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java @@ -176,8 +176,8 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority private static final String PROP_DEFAULT_MTU = "i2np.udp.mtu"; private static final String PROP_ADVANCED = "routerconsole.advanced"; - private static final String CAP_TESTING = "" + UDPAddress.CAPACITY_TESTING; - private static final String CAP_TESTING_INTRO = "" + UDPAddress.CAPACITY_TESTING + UDPAddress.CAPACITY_INTRODUCER; + private static final String CAP_TESTING = Character.toString(UDPAddress.CAPACITY_TESTING); + private static final String CAP_TESTING_INTRO = CAP_TESTING + UDPAddress.CAPACITY_INTRODUCER; /** how many relays offered to us will we use at a time? */ public static final int PUBLIC_RELAY_COUNT = 3; -- GitLab