forked from I2P_Developers/i2p.i2p
dont use equalsIgnoreCase() for booleans
This commit is contained in:
@@ -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;
|
||||
|
@@ -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");
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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";
|
||||
|
@@ -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 "";
|
||||
}
|
||||
|
Reference in New Issue
Block a user