dont use equalsIgnoreCase() for booleans

This commit is contained in:
zzz
2011-11-28 21:52:49 +00:00
parent d9dcb1e583
commit 8619fd2c05
14 changed files with 25 additions and 25 deletions

View File

@ -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();
}

View File

@ -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;
}

View File

@ -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

View File

@ -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: "