diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java index d31b8c3d1120a3347a123b895bf805ab524f68c6..6814cd27b4e0bb9a2df86e99866949238a2ffe4f 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java @@ -738,7 +738,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging { String proxy = ""; boolean isShared = true; if (args.length > 1) { - if ("true".equalsIgnoreCase(args[1].trim())) { + if (Boolean.valueOf(args[1].trim()).booleanValue()) { isShared = true; if (args.length == 3) proxy = args[2]; @@ -807,7 +807,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging { String proxy = ""; boolean isShared = true; if (args.length > 1) { - if ("true".equalsIgnoreCase(args[1].trim())) { + if (Boolean.valueOf(args[1].trim()).booleanValue()) { isShared = true; if (args.length == 3) proxy = args[2]; @@ -878,7 +878,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging { boolean isShared = true; if (args.length > 2) { - if ("true".equalsIgnoreCase(args[2].trim())) { + if (Boolean.valueOf(args[2].trim()).booleanValue()) { isShared = true; } else if ("false".equalsIgnoreCase(args[2].trim())) { _log.warn("args[2] == [" + args[2] + "] and rejected explicitly"); @@ -945,7 +945,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging { boolean isShared = false; if (args.length > 1) - isShared = "true".equalsIgnoreCase(args[1].trim()); + isShared = Boolean.valueOf(args[1].trim()).booleanValue(); ownDest = !isShared; try { @@ -989,7 +989,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging { boolean isShared = false; if (args.length == 2) - isShared = "true".equalsIgnoreCase(args[1].trim()); + isShared = Boolean.valueOf(args[1].trim()).booleanValue(); ownDest = !isShared; String privateKeyFile = null; diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java index d30aa3e4bbd08c0e42228c35f6dbb6223ca278a2..33563f175b67829e57e81e4090309bb568894d29 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java @@ -101,7 +101,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem // Ref: RFC 2617 // If the socket is an InternalSocket, no auth required. String authRequired = getTunnel().getClientOptions().getProperty(PROP_AUTH); - if (authRequired != null && (authRequired.equalsIgnoreCase("true") || authRequired.equalsIgnoreCase("basic"))) { + if (Boolean.valueOf(authRequired).booleanValue() || "basic".equalsIgnoreCase(authRequired)) { if (s instanceof InternalSocket) { if (_log.shouldLog(Log.INFO)) _log.info(getPrefix(requestId) + "Internal access, no auth required"); diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java index 94edfac46a408432ed611373e6210da3e546aebe..7c231add180afc7f11daa7cec41b229bbd5c64e4 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelServer.java @@ -177,7 +177,7 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable { if (_usePool) { String usePool = getTunnel().getClientOptions().getProperty(PROP_USE_POOL); if (usePool != null) - _usePool = "true".equalsIgnoreCase(usePool); + _usePool = Boolean.valueOf(usePool).booleanValue(); else _usePool = DEFAULT_USE_POOL; } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java index 7653efb508dc9bcbb06428c0fd3679897e90990f..14771b339f818365b9f9b15977a3212977537f7f 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java @@ -482,7 +482,7 @@ public class TunnelController implements Logging { /** default true */ public String getSharedClient() { return _config.getProperty("sharedClient", "true"); } /** default true */ - public boolean getStartOnLoad() { return "true".equalsIgnoreCase(_config.getProperty("startOnLoad", "true")); } + public boolean getStartOnLoad() { return Boolean.valueOf(_config.getProperty("startOnLoad", "true")).booleanValue(); } public boolean getPersistentClientKey() { return Boolean.valueOf(_config.getProperty("option.persistentClientKey")).booleanValue(); } public String getMyDestination() { if (_tunnel != null) { 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 100e87bb6458dd6debb4c9bfc60ca770a4645780..935abdd2fe311ff86c6fff7a3a5b3f41202e3f68 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java @@ -114,7 +114,7 @@ public class EditBean extends IndexBean { public boolean isSharedClient(int tunnel) { TunnelController tun = getController(tunnel); if (tun != null) - return "true".equalsIgnoreCase(tun.getSharedClient()); + return Boolean.valueOf(tun.getSharedClient()).booleanValue(); else return false; } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java index 3364b0a34add70f19e6484be27b6ec0eb237662a..3b658b65e9dad270605035408b532d57a969557a 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -266,7 +266,7 @@ public class IndexBean { } // Only modify other shared tunnels // if the current tunnel is shared, and of supported type - if ("true".equalsIgnoreCase(cur.getSharedClient()) && isClient(cur.getType())) { + if (Boolean.valueOf(cur.getSharedClient()).booleanValue() && isClient(cur.getType())) { // all clients use the same I2CP session, and as such, use the same I2CP options List controllers = _group.getControllers(); @@ -278,7 +278,7 @@ public class IndexBean { // Only modify this non-current tunnel // if it belongs to a shared destination, and is of supported type - if ("true".equalsIgnoreCase(c.getSharedClient()) && isClient(c.getType())) { + if (Boolean.valueOf(c.getSharedClient()).booleanValue() && isClient(c.getType())) { Properties cOpt = c.getConfig(""); if (_tunnelQuantity != null) { cOpt.setProperty("option.inbound.quantity", _tunnelQuantity); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java index 905b12b6f255b0eb2c005f3607e21d94ba6996b5..9427a3e8a59eed8f9937c9665105cbef02a3c088 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHandler.java @@ -169,7 +169,7 @@ public class ConfigNetHandler extends FormHandler { String oldNPort = _context.getProperty(ConfigNetHelper.PROP_I2NP_NTCP_PORT, ""); String oldAutoHost = _context.getProperty(ConfigNetHelper.PROP_I2NP_NTCP_AUTO_IP, "true"); String sAutoPort = _context.getProperty(ConfigNetHelper.PROP_I2NP_NTCP_AUTO_PORT, "true"); - boolean oldAutoPort = "true".equalsIgnoreCase(sAutoPort); + boolean oldAutoPort = Boolean.valueOf(sAutoPort).booleanValue(); if (_ntcpHostname == null) _ntcpHostname = ""; if (_ntcpPort == null) _ntcpPort = ""; if (_ntcpAutoIP == null) _ntcpAutoIP = "true"; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java index d8ea992b0d2d2342313853433e8c129efa3e8058..9e44b7a2d3d06538fb6f745ee8038c838151c53e 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java @@ -68,8 +68,8 @@ public class ConfigNetHelper extends HelperBase { } public String getEnableTimeSyncChecked() { - String disabled = _context.getProperty(Timestamper.PROP_DISABLED, "false"); - if ( (disabled != null) && ("true".equalsIgnoreCase(disabled)) ) + boolean disabled = _context.getBooleanProperty(Timestamper.PROP_DISABLED); + if (disabled) return ""; else return CHECKED; @@ -77,7 +77,7 @@ public class ConfigNetHelper extends HelperBase { /** @param prop must default to false */ public String getChecked(String prop) { - if (Boolean.valueOf(_context.getProperty(prop)).booleanValue()) + if (_context.getBooleanProperty(prop)) return CHECKED; return ""; } @@ -130,7 +130,7 @@ public class ConfigNetHelper extends HelperBase { /** default true */ public String getUpnpChecked() { - if (Boolean.valueOf(_context.getProperty(TransportManager.PROP_ENABLE_UPNP, "true")).booleanValue()) + if (_context.getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_UPNP)) return CHECKED; return ""; } diff --git a/core/java/src/freenet/support/CPUInformation/CPUID.java b/core/java/src/freenet/support/CPUInformation/CPUID.java index 197937496b21659bc9e7340be9fbe17727396bae..e063e4ec9604c03b5e0507b46b3297a2337969ff 100644 --- a/core/java/src/freenet/support/CPUInformation/CPUID.java +++ b/core/java/src/freenet/support/CPUInformation/CPUID.java @@ -260,7 +260,7 @@ public class CPUID { private static final void loadNative() { try{ String wantedProp = System.getProperty("jcpuid.enable", "true"); - boolean wantNative = "true".equalsIgnoreCase(wantedProp); + boolean wantNative = Boolean.valueOf(wantedProp).booleanValue(); if (wantNative) { boolean loaded = loadGeneric(); if (loaded) { diff --git a/core/java/src/net/i2p/util/NativeBigInteger.java b/core/java/src/net/i2p/util/NativeBigInteger.java index 74dd5b1d01a00ec6dc2aaa24c59e9fcb97426973..42dd9edf5b3c91a2d98d5391ff36fc07d48c82f6 100644 --- a/core/java/src/net/i2p/util/NativeBigInteger.java +++ b/core/java/src/net/i2p/util/NativeBigInteger.java @@ -460,7 +460,7 @@ public class NativeBigInteger extends BigInteger { private static final void loadNative() { try{ String wantedProp = System.getProperty("jbigi.enable", "true"); - boolean wantNative = "true".equalsIgnoreCase(wantedProp); + boolean wantNative = Boolean.valueOf(wantedProp).booleanValue(); if (wantNative) { debug("trying loadGeneric"); boolean loaded = loadGeneric("jbigi"); diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java index 66de4c743e0f77be29d4405abd3ccb041bfe2503..77994bdb3a584a67ce61a5611167aa6226d3c516 100644 --- a/router/java/src/net/i2p/router/Router.java +++ b/router/java/src/net/i2p/router/Router.java @@ -1116,7 +1116,7 @@ public class Router implements RouterClock.ClockShiftListener { _log.log(Log.CRIT, "Shutdown(" + exitCode + ") complete" /* , new Exception("Shutdown") */ ); try { _context.logManager().shutdown(); } catch (Throwable t) { } if (ALLOW_DYNAMIC_KEYS) { - if (Boolean.valueOf(_context.getProperty(PROP_DYNAMIC_KEYS)).booleanValue()) + if (_context.getBooleanProperty(PROP_DYNAMIC_KEYS)) killKeys(); } diff --git a/router/java/src/net/i2p/router/TunnelPoolSettings.java b/router/java/src/net/i2p/router/TunnelPoolSettings.java index f4a9618aaadfe38fd9fd0b038504a20752a5ca05..533eceaeb1ec1a1b0e1b981491a814c46f86db42 100644 --- a/router/java/src/net/i2p/router/TunnelPoolSettings.java +++ b/router/java/src/net/i2p/router/TunnelPoolSettings.java @@ -236,7 +236,7 @@ public class TunnelPoolSettings { private static final boolean getBoolean(String str, boolean defaultValue) { if (str == null) return defaultValue; - boolean v = "TRUE".equalsIgnoreCase(str) || "YES".equalsIgnoreCase(str); + boolean v = Boolean.valueOf(str).booleanValue() || "YES".equalsIgnoreCase(str); return v; } diff --git a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java index ce51a6134c2c4e6504934ef2d6e686d9c12a0b75..634a8c8f5f3bc2a03732b92f8926c458fe98c102 100644 --- a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java +++ b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java @@ -329,7 +329,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade { if (_log.shouldLog(Log.INFO)) _log.info("old: " + ohost + " config: " + name + " auto: " + enabled + " status: " + status); if (enabled.equalsIgnoreCase("always") || - (enabled.equalsIgnoreCase("true") && status == STATUS_OK)) { + (Boolean.valueOf(enabled).booleanValue() && status == STATUS_OK)) { String nhost = UDPProps.getProperty(UDPAddress.PROP_HOST); if (_log.shouldLog(Log.INFO)) _log.info("old: " + ohost + " config: " + name + " new: " + nhost); @@ -352,7 +352,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade { changed = true; } else if (ohost == null || ohost.length() <= 0) { return; - } else if (enabled.equalsIgnoreCase("true") && status != STATUS_OK) { + } else if (Boolean.valueOf(enabled).booleanValue() && status != STATUS_OK) { // UDP transitioned to not-OK, turn off NTCP address // This will commonly happen at startup if we were initially OK // because UPnP was successful, but a subsequent SSU Peer Test determines 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 2f0eabad057fb8385b79d05fd11568d80b333991..819487cf0ac58a9d45f277cfd9d0274496bee712 100644 --- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java +++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java @@ -584,7 +584,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority // For now, only do this at startup if (oldIP != null && System.getProperty("wrapper.version") != null && - Boolean.valueOf(_context.getProperty(PROP_LAPTOP_MODE)).booleanValue() && + _context.getBooleanProperty(PROP_LAPTOP_MODE) && now - lastChanged > 10*60*1000 && _context.router().getUptime() < 10*60*1000) { _log.log(Log.CRIT, "IP changed, restarting with a new identity and port"); @@ -613,7 +613,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority if (addr.length < 4) return false; if (isPubliclyRoutable(addr)) return true; - return Boolean.valueOf(_context.getProperty("i2np.udp.allowLocal")).booleanValue(); + return _context.getBooleanProperty("i2np.udp.allowLocal"); } private boolean getIsPortFixed() { @@ -1364,7 +1364,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority if ( (old.getPort() != newAddr.getPort()) || (!oldHost.equals(newHost)) ) { // substantial data has changed, so if we are in 'dynamic keys' mode, restart the // router hard and regenerate a new identity - if ("true".equalsIgnoreCase(_context.getProperty(Router.PROP_DYNAMIC_KEYS, "false"))) { + if (_context.getBooleanProperty(Router.PROP_DYNAMIC_KEYS)) { if (_log.shouldLog(Log.ERROR)) _log.error("SSU address updated. new address: " + newAddr.getHostAddress() + ":" + newAddr.getPort() + ", old address: "