replace more equalsIgnoreCase() calls

This commit is contained in:
zzz
2011-11-28 22:55:10 +00:00
parent 8619fd2c05
commit 6b811b36b9
17 changed files with 61 additions and 43 deletions

View File

@ -1,5 +1,6 @@
package net.i2p.router;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
@ -236,7 +237,8 @@ public class TunnelPoolSettings {
private static final boolean getBoolean(String str, boolean defaultValue) {
if (str == null) return defaultValue;
boolean v = Boolean.valueOf(str).booleanValue() || "YES".equalsIgnoreCase(str);
boolean v = Boolean.valueOf(str).booleanValue() ||
(str != null && "YES".equals(str.toUpperCase(Locale.US)));
return v;
}

View File

@ -15,6 +15,7 @@ import java.net.Socket;
import java.util.concurrent.ConcurrentHashMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
@ -192,7 +193,7 @@ class ClientConnectionRunner {
_config = config;
// This is the only option that is interpreted here, not at the tunnel manager
if (config.getOptions() != null)
_dontSendMSM = "none".equalsIgnoreCase(config.getOptions().getProperty(I2PClient.PROP_RELIABILITY));
_dontSendMSM = "none".equals(config.getOptions().getProperty(I2PClient.PROP_RELIABILITY, "").toLowerCase(Locale.US));
// per-destination session key manager to prevent rather easy correlation
if (_sessionKeyManager == null)
_sessionKeyManager = new TransientSessionKeyManager(_context);

View File

@ -12,6 +12,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.StringTokenizer;
@ -202,7 +203,7 @@ public class Reseeder {
// We do this more than once, because
// the first SSL handshake may take a while, and it may take the server
// a while to render the index page.
if (_gotDate < MAX_DATE_SETS && "date".equalsIgnoreCase(key) && _attemptStarted > 0) {
if (_gotDate < MAX_DATE_SETS && "date".equals(key.toLowerCase(Locale.US)) && _attemptStarted > 0) {
long timeRcvd = System.currentTimeMillis();
long serverTime = RFC822Date.parse822Date(val);
if (serverTime > 0) {

View File

@ -317,7 +317,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
// And new "always" setting ignores reachability status, like
// "true" was in 0.7.3
String ohost = newProps.getProperty(NTCPAddress.PROP_HOST);
String enabled = _context.getProperty(PROP_I2NP_NTCP_AUTO_IP, "true");
String enabled = _context.getProperty(PROP_I2NP_NTCP_AUTO_IP, "true").toLowerCase(Locale.US);
String name = _context.getProperty(PROP_I2NP_NTCP_HOSTNAME);
// hostname config trumps auto config
if (name != null && name.length() > 0)
@ -328,7 +328,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
status = udp.getReachabilityStatus();
if (_log.shouldLog(Log.INFO))
_log.info("old: " + ohost + " config: " + name + " auto: " + enabled + " status: " + status);
if (enabled.equalsIgnoreCase("always") ||
if (enabled.equals("always") ||
(Boolean.valueOf(enabled).booleanValue() && status == STATUS_OK)) {
String nhost = UDPProps.getProperty(UDPAddress.PROP_HOST);
if (_log.shouldLog(Log.INFO))
@ -339,7 +339,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
newProps.setProperty(NTCPAddress.PROP_HOST, nhost);
changed = true;
}
} else if (enabled.equalsIgnoreCase("false") &&
} else if (enabled.equals("false") &&
name != null && name.length() > 0 &&
!name.equals(ohost) &&
nport != null) {