Boolean.valueOf(x).booleanValue() -> Boolean.parseBoolean(x)

This commit is contained in:
zzz
2012-09-28 17:50:41 +00:00
parent 7c8ba61f03
commit fb5d0cd760
54 changed files with 107 additions and 108 deletions

View File

@ -230,7 +230,7 @@ public class Daemon {
*/
public static void update(Map<String, String> settings, String home) {
File published = null;
boolean should_publish = Boolean.valueOf(settings.get("should_publish")).booleanValue();
boolean should_publish = Boolean.parseBoolean(settings.get("should_publish"));
if (should_publish)
published = new File(home, settings
.get("published_addressbook"));
@ -261,7 +261,7 @@ public class Daemon {
// If false, add hosts via naming service; if true, write hosts.txt file directly
// Default false
if (Boolean.valueOf(settings.get("update_direct")).booleanValue()) {
if (Boolean.parseBoolean(settings.get("update_direct"))) {
// Direct hosts.txt access
File routerFile = new File(home, settings.get("router_addressbook"));
AddressBook master;

View File

@ -200,11 +200,11 @@ public class SnarkManager implements Snark.CompleteListener {
* @since 0.8.9
*/
public boolean areFilesPublic() {
return Boolean.valueOf(_config.getProperty(PROP_FILES_PUBLIC)).booleanValue();
return Boolean.parseBoolean(_config.getProperty(PROP_FILES_PUBLIC));
}
public boolean shouldAutoStart() {
return Boolean.valueOf(_config.getProperty(PROP_AUTO_START, DEFAULT_AUTO_START)).booleanValue();
return Boolean.parseBoolean(_config.getProperty(PROP_AUTO_START, DEFAULT_AUTO_START));
}
/****
@ -384,11 +384,11 @@ public class SnarkManager implements Snark.CompleteListener {
if (ot != null)
_util.setOpenTrackers(getOpenTrackers());
String useOT = _config.getProperty(PROP_USE_OPENTRACKERS);
boolean bOT = useOT == null || Boolean.valueOf(useOT).booleanValue();
boolean bOT = useOT == null || Boolean.parseBoolean(useOT);
_util.setUseOpenTrackers(bOT);
// careful, so we can switch default to true later
_util.setUseDHT(Boolean.valueOf(_config.getProperty(PROP_USE_DHT,
Boolean.toString(I2PSnarkUtil.DEFAULT_USE_DHT))).booleanValue());
_util.setUseDHT(Boolean.parseBoolean(_config.getProperty(PROP_USE_DHT,
Boolean.toString(I2PSnarkUtil.DEFAULT_USE_DHT))));
getDataDir().mkdirs();
initTrackerMap();
}

View File

@ -694,7 +694,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
public void runClient(String args[], Logging l) {
boolean isShared = true;
if (args.length >= 3)
isShared = Boolean.valueOf(args[2].trim()).booleanValue();
isShared = Boolean.parseBoolean(args[2].trim());
if (args.length >= 2) {
int portNum = -1;
try {
@ -766,7 +766,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
String proxy = "";
boolean isShared = true;
if (args.length > 1) {
if (Boolean.valueOf(args[1].trim()).booleanValue()) {
if (Boolean.parseBoolean(args[1].trim())) {
isShared = true;
if (args.length == 3)
proxy = args[2];
@ -835,7 +835,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
String proxy = "";
boolean isShared = true;
if (args.length > 1) {
if (Boolean.valueOf(args[1].trim()).booleanValue()) {
if (Boolean.parseBoolean(args[1].trim())) {
isShared = true;
if (args.length == 3)
proxy = args[2];
@ -906,7 +906,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
boolean isShared = true;
if (args.length > 2) {
if (Boolean.valueOf(args[2].trim()).booleanValue()) {
if (Boolean.parseBoolean(args[2].trim())) {
isShared = true;
} else if ("false".equalsIgnoreCase(args[2].trim())) {
_log.warn("args[2] == [" + args[2] + "] and rejected explicitly");
@ -973,7 +973,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
boolean isShared = false;
if (args.length > 1)
isShared = Boolean.valueOf(args[1].trim()).booleanValue();
isShared = Boolean.parseBoolean(args[1].trim());
ownDest = !isShared;
try {
@ -1017,7 +1017,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
boolean isShared = false;
if (args.length == 2)
isShared = Boolean.valueOf(args[1].trim()).booleanValue();
isShared = Boolean.parseBoolean(args[1].trim());
ownDest = !isShared;
String privateKeyFile = null;

View File

@ -190,11 +190,11 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
// no need to load the netDb with leaseSets for destinations that will never
// be looked up
boolean dccEnabled = (this instanceof I2PTunnelIRCClient) &&
Boolean.valueOf(tunnel.getClientOptions().getProperty(I2PTunnelIRCClient.PROP_DCC)).booleanValue();
Boolean.parseBoolean(tunnel.getClientOptions().getProperty(I2PTunnelIRCClient.PROP_DCC));
if (!dccEnabled)
tunnel.getClientOptions().setProperty("i2cp.dontPublishLeaseSet", "true");
boolean openNow = !Boolean.valueOf(tunnel.getClientOptions().getProperty("i2cp.delayOpen")).booleanValue();
boolean openNow = !Boolean.parseBoolean(tunnel.getClientOptions().getProperty("i2cp.delayOpen"));
if (openNow) {
while (sockMgr == null) {
verifySocketManager();
@ -258,8 +258,8 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
if (sess == null) {
newManager = true;
} else if (sess.isClosed() &&
Boolean.valueOf(getTunnel().getClientOptions().getProperty("i2cp.closeOnIdle")).booleanValue() &&
Boolean.valueOf(getTunnel().getClientOptions().getProperty("i2cp.newDestOnResume")).booleanValue()) {
Boolean.parseBoolean(getTunnel().getClientOptions().getProperty("i2cp.closeOnIdle")) &&
Boolean.parseBoolean(getTunnel().getClientOptions().getProperty("i2cp.newDestOnResume"))) {
// build a new socket manager and a new dest if the session is closed.
getTunnel().removeSession(sess);
if (_log.shouldLog(Log.WARN))

View File

@ -253,7 +253,7 @@ public class I2PTunnelConnectClient extends I2PTunnelHTTPClientBase implements R
line = null;
} else {
// Add Proxy-Authentication header for next hop (outproxy)
if (usingWWWProxy && Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_AUTH)).booleanValue()) {
if (usingWWWProxy && Boolean.parseBoolean(getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_AUTH))) {
// specific for this proxy
String user = getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_USER_PREFIX + currentProxy);
String pw = getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_PW_PREFIX + currentProxy);

View File

@ -521,7 +521,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
// Try to find an address helper in the query
String[] helperStrings = removeHelper(query);
if(helperStrings != null &&
!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER)).booleanValue()) {
!Boolean.parseBoolean(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER))) {
query = helperStrings[0];
if(query.equals("")) {
query = null;
@ -736,7 +736,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
} else if(lowercaseLine.startsWith("user-agent: ")) {
// save for deciding whether to offer address book form
userAgent = lowercaseLine.substring(12);
if(!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_USER_AGENT)).booleanValue()) {
if(!Boolean.parseBoolean(getTunnel().getClientOptions().getProperty(PROP_USER_AGENT))) {
line = null;
continue;
}
@ -746,13 +746,13 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
line = null;
continue;
} else if(lowercaseLine.startsWith("referer: ") &&
!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_REFERER)).booleanValue()) {
!Boolean.parseBoolean(getTunnel().getClientOptions().getProperty(PROP_REFERER))) {
// Shouldn't we be more specific, like accepting in-site referers ?
//line = "Referer: i2p";
line = null;
continue; // completely strip the line
} else if(lowercaseLine.startsWith("via: ") &&
!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_VIA)).booleanValue()) {
!Boolean.parseBoolean(getTunnel().getClientOptions().getProperty(PROP_VIA))) {
//line = "Via: i2p";
line = null;
continue; // completely strip the line
@ -786,7 +786,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
String ok = getTunnel().getClientOptions().getProperty("i2ptunnel.gzip");
boolean gzip = DEFAULT_GZIP;
if(ok != null) {
gzip = Boolean.valueOf(ok).booleanValue();
gzip = Boolean.parseBoolean(ok);
}
if(gzip && !usingInternalServer) {
// according to rfc2616 s14.3, this *should* force identity, even if
@ -796,7 +796,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
newRequest.append("X-Accept-Encoding: x-i2p-gzip;q=1.0, identity;q=0.5, deflate;q=0, gzip;q=0, *;q=0\r\n");
}
if(!shout) {
if(!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_USER_AGENT)).booleanValue()) {
if(!Boolean.parseBoolean(getTunnel().getClientOptions().getProperty(PROP_USER_AGENT))) {
// let's not advertise to external sites that we are from I2P
if(usingWWWProxy) {
newRequest.append("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6\r\n");
@ -806,7 +806,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
}
}
// Add Proxy-Authentication header for next hop (outproxy)
if(usingWWWProxy && Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_AUTH)).booleanValue()) {
if(usingWWWProxy && Boolean.parseBoolean(getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_AUTH))) {
// specific for this proxy
String user = getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_USER_PREFIX + currentProxy);
String pw = getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_PW_PREFIX + currentProxy);
@ -869,7 +869,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
if(usingInternalServer) {
// disable the add form if address helper is disabled
if(internalPath.equals("/add") &&
Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER)).booleanValue()) {
Boolean.parseBoolean(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER))) {
out.write(ERR_HELPER_DISABLED);
} else {
LocalHTTPServer.serveLocalFile(out, method, internalPath, internalRawQuery, _proxyNonce);
@ -949,7 +949,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
// Don't do this for eepget, which uses a user-agent of "Wget"
if(ahelperNew && "GET".equals(method) &&
(userAgent == null || !userAgent.startsWith("Wget")) &&
!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER)).booleanValue()) {
!Boolean.parseBoolean(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER))) {
writeHelperSaveForm(out, destination, ahelperKey, targetRequest);
s.close();
return;

View File

@ -100,7 +100,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 (Boolean.valueOf(authRequired).booleanValue() ||
if (Boolean.parseBoolean(authRequired) ||
(authRequired != null && "basic".equals(authRequired.toLowerCase(Locale.US)))) {
if (s instanceof InternalSocket) {
if (_log.shouldLog(Log.INFO))

View File

@ -154,7 +154,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
boolean allowGZIP = true;
if (opts != null) {
String val = opts.getProperty("i2ptunnel.gzip");
if ( (val != null) && (!Boolean.valueOf(val).booleanValue()) )
if ( (val != null) && (!Boolean.parseBoolean(val)) )
allowGZIP = false;
}
if (_log.shouldLog(Log.INFO))

View File

@ -87,7 +87,7 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase {
setName("IRC Client on " + tunnel.listenHost + ':' + localPort);
_dccEnabled = Boolean.valueOf(tunnel.getClientOptions().getProperty(PROP_DCC)).booleanValue();
_dccEnabled = Boolean.parseBoolean(tunnel.getClientOptions().getProperty(PROP_DCC));
// TODO add some prudent tunnel options (or is it too late?)
startRunning();

View File

@ -191,7 +191,7 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
if (_usePool) {
String usePool = getTunnel().getClientOptions().getProperty(PROP_USE_POOL);
if (usePool != null)
_usePool = Boolean.valueOf(usePool).booleanValue();
_usePool = Boolean.parseBoolean(usePool);
else
_usePool = DEFAULT_USE_POOL;
}

View File

@ -536,8 +536,8 @@ public class TunnelController implements Logging {
/** default true */
public String getSharedClient() { return _config.getProperty("sharedClient", "true"); }
/** default true */
public boolean getStartOnLoad() { return Boolean.valueOf(_config.getProperty("startOnLoad", "true")).booleanValue(); }
public boolean getPersistentClientKey() { return Boolean.valueOf(_config.getProperty("option.persistentClientKey")).booleanValue(); }
public boolean getStartOnLoad() { return Boolean.parseBoolean(_config.getProperty("startOnLoad", "true")); }
public boolean getPersistentClientKey() { return Boolean.parseBoolean(_config.getProperty("option.persistentClientKey")); }
public String getMyDestination() {
if (_tunnel != null) {

View File

@ -61,7 +61,7 @@ public class SOCKS5Server extends SOCKSServer {
this.clientSock = clientSock;
this.props = props;
this.authRequired =
Boolean.valueOf(props.getProperty(I2PTunnelHTTPClientBase.PROP_AUTH)).booleanValue() &&
Boolean.parseBoolean(props.getProperty(I2PTunnelHTTPClientBase.PROP_AUTH)) &&
props.containsKey(I2PTunnelHTTPClientBase.PROP_USER) &&
props.containsKey(I2PTunnelHTTPClientBase.PROP_PW);
}
@ -181,7 +181,7 @@ public class SOCKS5Server extends SOCKSServer {
sendRequestReply(Reply.COMMAND_NOT_SUPPORTED, AddressType.DOMAINNAME, null, "0.0.0.0", 0, out);
throw new SOCKSException("BIND command not supported");
case Command.UDP_ASSOCIATE:
/*** if(!Boolean.valueOf(tunnel.getOptions().getProperty("i2ptunnel.socks.allowUDP")).booleanValue()) {
/*** if(!Boolean.parseBoolean(tunnel.getOptions().getProperty("i2ptunnel.socks.allowUDP"))) {
_log.debug("UDP ASSOCIATE command is not supported!");
sendRequestReply(Reply.COMMAND_NOT_SUPPORTED, AddressType.DOMAINNAME, null, "0.0.0.0", 0, out);
throw new SOCKSException("UDP ASSOCIATE command not supported");
@ -463,7 +463,7 @@ public class SOCKS5Server extends SOCKSServer {
I2PSocket destSock = tun.createI2PSocket(I2PAppContext.getGlobalContext().namingService().lookup(proxy), proxyOpts);
try {
DataOutputStream out = new DataOutputStream(destSock.getOutputStream());
boolean authAvail = Boolean.valueOf(props.getProperty(I2PTunnelHTTPClientBase.PROP_OUTPROXY_AUTH)).booleanValue();
boolean authAvail = Boolean.parseBoolean(props.getProperty(I2PTunnelHTTPClientBase.PROP_OUTPROXY_AUTH));
String configUser = null;
String configPW = null;
if (authAvail) {

View File

@ -49,7 +49,7 @@ public class SOCKSServerFactory {
switch (socksVer) {
case 0x04:
// SOCKS version 4/4a
if (Boolean.valueOf(props.getProperty(I2PTunnelHTTPClientBase.PROP_AUTH)).booleanValue() &&
if (Boolean.parseBoolean(props.getProperty(I2PTunnelHTTPClientBase.PROP_AUTH)) &&
props.containsKey(I2PTunnelHTTPClientBase.PROP_USER) &&
props.containsKey(I2PTunnelHTTPClientBase.PROP_PW)) {
throw new SOCKSException("SOCKS 4/4a not supported when authorization is required");

View File

@ -114,7 +114,7 @@ public class EditBean extends IndexBean {
public boolean isSharedClient(int tunnel) {
TunnelController tun = getController(tunnel);
if (tun != null)
return Boolean.valueOf(tun.getSharedClient()).booleanValue();
return Boolean.parseBoolean(tun.getSharedClient());
else
return false;
}
@ -312,7 +312,7 @@ public class EditBean extends IndexBean {
if (tun != null) {
Properties opts = getOptions(tun);
if (opts != null)
return Boolean.valueOf(opts.getProperty(prop)).booleanValue();
return Boolean.parseBoolean(opts.getProperty(prop));
}
return false;
}

View File

@ -266,7 +266,7 @@ public class IndexBean {
}
// Only modify other shared tunnels
// if the current tunnel is shared, and of supported type
if (Boolean.valueOf(cur.getSharedClient()).booleanValue() && isClient(cur.getType())) {
if (Boolean.parseBoolean(cur.getSharedClient()) && 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 (Boolean.valueOf(c.getSharedClient()).booleanValue() && isClient(c.getType())) {
if (Boolean.parseBoolean(c.getSharedClient()) && isClient(c.getType())) {
Properties cOpt = c.getConfig("");
if (_tunnelQuantity != null) {
cOpt.setProperty("option.inbound.quantity", _tunnelQuantity);

View File

@ -218,7 +218,7 @@ public class ConfigClientsHelper extends HelperBase {
.append("<a href=\"").append(updateURL).append("\">").append(_("Update link")).append("</a><td>&nbsp;");
}
desc.append("</table>");
boolean enableStop = !Boolean.valueOf(appProps.getProperty("disableStop")).booleanValue();
boolean enableStop = !Boolean.parseBoolean(appProps.getProperty("disableStop"));
enableStop &= PluginStarter.isPluginRunning(app, _context);
boolean enableStart = !PluginStarter.isPluginRunning(app, _context);
renderForm(buf, app, app, false,

View File

@ -184,7 +184,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 = Boolean.valueOf(sAutoPort).booleanValue();
boolean oldAutoPort = Boolean.parseBoolean(sAutoPort);
if (_ntcpHostname == null) _ntcpHostname = "";
if (_ntcpPort == null) _ntcpPort = "";
if (_ntcpAutoIP == null) _ntcpAutoIP = "true";
@ -265,7 +265,7 @@ public class ConfigNetHandler extends FormHandler {
changes.put(Router.PROP_DYNAMIC_KEYS, "" + _dynamicKeys);
if (Boolean.valueOf(_context.getProperty(TransportManager.PROP_ENABLE_UPNP)).booleanValue() !=
if (Boolean.parseBoolean(_context.getProperty(TransportManager.PROP_ENABLE_UPNP)) !=
_upnp) {
// This is minor, don't set restartRequired
if (_upnp)
@ -275,7 +275,7 @@ public class ConfigNetHandler extends FormHandler {
}
changes.put(TransportManager.PROP_ENABLE_UPNP, "" + _upnp);
if (Boolean.valueOf(_context.getProperty(UDPTransport.PROP_LAPTOP_MODE)).booleanValue() !=
if (Boolean.parseBoolean(_context.getProperty(UDPTransport.PROP_LAPTOP_MODE)) !=
_laptop) {
// This is minor, don't set restartRequired
if (_laptop)

View File

@ -74,15 +74,14 @@ public class ConfigUpdateHelper extends HelperBase {
public String getUpdateThroughProxy() {
String proxy = _context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY);
if (Boolean.valueOf(proxy).booleanValue())
if (Boolean.parseBoolean(proxy))
return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateThroughProxy\" checked=\"checked\" >";
else
return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateThroughProxy\" >";
}
public String getUpdateUnsigned() {
String foo = _context.getProperty(ConfigUpdateHandler.PROP_UPDATE_UNSIGNED);
if (Boolean.valueOf(foo).booleanValue())
if (_context.getBooleanProperty(ConfigUpdateHandler.PROP_UPDATE_UNSIGNED))
return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateUnsigned\" checked=\"checked\" >";
else
return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateUnsigned\" >";

View File

@ -16,7 +16,7 @@ public class ContentHelper extends HelperBase {
*/
public void setPage(String page) { _page = page; }
public void setStartAtBeginning(String moo) {
_startAtBeginning = Boolean.valueOf(""+moo).booleanValue();
_startAtBeginning = Boolean.parseBoolean(moo);
}
public void setLang(String l) {
/*****

View File

@ -172,7 +172,7 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
boolean dontInstall() {
File test = new File(_context.getBaseDir(), "history.txt");
boolean readonly = ((test.exists() && !test.canWrite()) || (!_context.getBaseDir().canWrite()));
boolean disabled = Boolean.valueOf(_context.getProperty(ConfigUpdateHandler.PROP_UPDATE_DISABLED)).booleanValue();
boolean disabled = _context.getBooleanProperty(ConfigUpdateHandler.PROP_UPDATE_DISABLED);
return readonly || disabled;
}
@ -220,7 +220,7 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
public void fetchNews() {
String newsURL = ConfigUpdateHelper.getNewsURL(_context);
boolean shouldProxy = Boolean.valueOf(_context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY)).booleanValue();
boolean shouldProxy = Boolean.parseBoolean(_context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY));
String proxyHost = _context.getProperty(ConfigUpdateHandler.PROP_PROXY_HOST, ConfigUpdateHandler.DEFAULT_PROXY_HOST);
int proxyPort = ConfigUpdateHandler.proxyPort(_context);
if (_tempFile.exists())
@ -252,7 +252,7 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
public boolean shouldFetchUnsigned() {
String url = _context.getProperty(ConfigUpdateHandler.PROP_ZIP_URL);
return url != null && url.length() > 0 &&
Boolean.valueOf(_context.getProperty(ConfigUpdateHandler.PROP_UPDATE_UNSIGNED)).booleanValue() &&
_context.getBooleanProperty(ConfigUpdateHandler.PROP_UPDATE_UNSIGNED) &&
!dontInstall();
}
@ -265,7 +265,7 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
if (url == null || url.length() <= 0)
return;
// assume always proxied for now
//boolean shouldProxy = Boolean.valueOf(_context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY)).booleanValue();
//boolean shouldProxy = Boolean.parseBoolean(_context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY));
String proxyHost = _context.getProperty(ConfigUpdateHandler.PROP_PROXY_HOST, ConfigUpdateHandler.DEFAULT_PROXY_HOST);
int proxyPort = _context.getProperty(ConfigUpdateHandler.PROP_PROXY_PORT, ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT);

View File

@ -61,12 +61,12 @@ public class PluginStarter implements Runnable {
}
static boolean pluginsEnabled(I2PAppContext ctx) {
return Boolean.valueOf(ctx.getProperty("router.enablePlugins", "true")).booleanValue();
return ctx.getBooleanPropertyDefaultTrue("router.enablePlugins");
}
public void run() {
if (_context.getBooleanPropertyDefaultTrue("plugins.autoUpdate") &&
(!Boolean.valueOf(System.getProperty(UpdateHandler.PROP_UPDATE_IN_PROGRESS)).booleanValue()) &&
(!Boolean.parseBoolean(System.getProperty(UpdateHandler.PROP_UPDATE_IN_PROGRESS))) &&
(!RouterVersion.VERSION.equals(_context.getProperty("router.previousVersion"))))
updateAll(_context, true);
startPlugins(_context);
@ -169,7 +169,7 @@ public class PluginStarter implements Runnable {
for (Iterator iter = props.keySet().iterator(); iter.hasNext(); ) {
String name = (String)iter.next();
if (name.startsWith(PREFIX) && name.endsWith(ENABLED)) {
if (Boolean.valueOf(props.getProperty(name)).booleanValue()) {
if (Boolean.parseBoolean(props.getProperty(name))) {
String app = name.substring(PREFIX.length(), name.lastIndexOf(ENABLED));
// plugins could have been started after update
if (isPluginRunning(app, ctx))
@ -508,7 +508,7 @@ public class PluginStarter implements Runnable {
public static boolean isPluginEnabled(String appName) {
Properties props = pluginProperties();
String prop = PREFIX + appName + ENABLED;
return Boolean.valueOf(props.getProperty(prop, "true")).booleanValue();
return Boolean.parseBoolean(props.getProperty(prop, "true"));
}
/**
@ -519,7 +519,7 @@ public class PluginStarter implements Runnable {
public static void disablePlugin(String appName) {
Properties props = pluginProperties();
String prop = PREFIX + appName + ENABLED;
if (Boolean.valueOf(props.getProperty(prop, "true")).booleanValue()) {
if (Boolean.parseBoolean(props.getProperty(prop, "true"))) {
props.setProperty(prop, "false");
storePluginProperties(props);
}

View File

@ -139,7 +139,7 @@ public class PluginUpdateHandler extends UpdateHandler {
} else {
updateStatus("<b>" + _("Downloading plugin from {0}", _xpi2pURL) + "</b>");
// use the same settings as for updater
boolean shouldProxy = Boolean.valueOf(_context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY)).booleanValue();
boolean shouldProxy = Boolean.parseBoolean(_context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY));
String proxyHost = _context.getProperty(ConfigUpdateHandler.PROP_PROXY_HOST, ConfigUpdateHandler.DEFAULT_PROXY_HOST);
int proxyPort = ConfigUpdateHandler.proxyPort(_context);
try {
@ -313,7 +313,7 @@ public class PluginUpdateHandler extends UpdateHandler {
boolean wasRunning = false;
File destDir = new SecureDirectory(appDir, appName);
if (destDir.exists()) {
if (Boolean.valueOf(props.getProperty("install-only")).booleanValue()) {
if (Boolean.parseBoolean(props.getProperty("install-only"))) {
to.delete();
statusDone("<b>" + _("Downloaded plugin is for new installs only, but the plugin is already installed", url) + "</b>");
return;
@ -374,7 +374,7 @@ public class PluginUpdateHandler extends UpdateHandler {
return;
}
// do we defer extraction and installation?
if (Boolean.valueOf(props.getProperty("router-restart-required")).booleanValue()) {
if (Boolean.parseBoolean(props.getProperty("router-restart-required"))) {
// Yup!
try {
if(!FileUtil.copy(to, (new SecureFile( new SecureFile(appDir.getCanonicalPath() +"/" + appName +"/"+ ZIP).getCanonicalPath())) , true, true)) {
@ -405,7 +405,7 @@ public class PluginUpdateHandler extends UpdateHandler {
}
update = true;
} else {
if (Boolean.valueOf(props.getProperty("update-only")).booleanValue()) {
if (Boolean.parseBoolean(props.getProperty("update-only"))) {
to.delete();
statusDone("<b>" + _("Plugin is for upgrades only, but the plugin is not installed") + "</b>");
return;
@ -426,7 +426,7 @@ public class PluginUpdateHandler extends UpdateHandler {
_updated = true;
to.delete();
// install != update. Changing the user's settings like this is probabbly a bad idea.
if (Boolean.valueOf( props.getProperty("dont-start-at-install")).booleanValue()) {
if (Boolean.parseBoolean( props.getProperty("dont-start-at-install"))) {
statusDone("<b>" + _("Plugin {0} installed", appName) + "</b>");
if(!update) {
Properties pluginProps = PluginStarter.pluginProperties();

View File

@ -120,8 +120,8 @@ public class SummaryHelper extends HelperBase {
public boolean allowReseed() {
return _context.netDb().isInitialized() &&
((_context.netDb().getKnownRouters() < 30) ||
Boolean.valueOf(_context.getProperty("i2p.alwaysAllowReseed")).booleanValue());
(_context.netDb().getKnownRouters() < 30) ||
_context.getBooleanProperty("i2p.alwaysAllowReseed");
}
/** subtract one for ourselves, so if we know no other peers it displays zero */

View File

@ -169,7 +169,7 @@ public class UpdateHandler {
// Alternative: In bytesTransferred(), Check the data in the output file after
// we've received at least 56 bytes. Need a cancel() method in EepGet ?
boolean shouldProxy = Boolean.valueOf(_context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY)).booleanValue();
boolean shouldProxy = Boolean.parseBoolean(_context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY));
String proxyHost = _context.getProperty(ConfigUpdateHandler.PROP_PROXY_HOST, ConfigUpdateHandler.DEFAULT_PROXY_HOST);
int proxyPort = ConfigUpdateHandler.proxyPort(_context);

View File

@ -252,7 +252,7 @@ public class SAMBridge implements Runnable {
}
SAMBridge bridge = new SAMBridge(host, port, opts, keyfile);
I2PAppThread t = new I2PAppThread(bridge, "SAMListener");
if (Boolean.valueOf(System.getProperty("sam.shutdownOnOOM", "false")).booleanValue()) {
if (Boolean.parseBoolean(System.getProperty("sam.shutdownOnOOM"))) {
t.addOOMEventThreadListener(new I2PAppThread.OOMEventListener() {
public void outOfMemory(OutOfMemoryError err) {
err.printStackTrace();

View File

@ -134,7 +134,7 @@ public class SAMStreamSession {
socketMgr.addDisconnectListener(new DisconnectListener());
forceFlush = Boolean.valueOf(allprops.getProperty(PROP_FORCE_FLUSH, DEFAULT_FORCE_FLUSH)).booleanValue();
forceFlush = Boolean.parseBoolean(allprops.getProperty(PROP_FORCE_FLUSH, DEFAULT_FORCE_FLUSH));
boolean canReceive = false;
if (dir.equals("BOTH")) {

View File

@ -764,7 +764,7 @@ class ConnectionOptions extends I2PSocketOptionsImpl {
if (opts == null) return defaultVal;
String val = opts.getProperty(name);
if (val == null) return defaultVal;
return Boolean.valueOf(val).booleanValue();
return Boolean.parseBoolean(val);
}
/****

View File

@ -49,7 +49,7 @@ public class SysTray implements SysTrayMenuListener {
_browserString = _configFile.getProperty("browser", "default");
_portString = _configFile.getProperty("port", "7657");
_showIcon = Boolean.valueOf(_configFile.getProperty("visible", "true")).booleanValue();
_showIcon = Boolean.parseBoolean(_configFile.getProperty("visible", "true"));
//if (!(new File("router.config")).exists())
// openRouterConsole("http://localhost:" + _portString + "/index.jsp");

View File

@ -260,7 +260,7 @@ public class CPUID {
private static final void loadNative() {
try{
String wantedProp = System.getProperty("jcpuid.enable", "true");
boolean wantNative = Boolean.valueOf(wantedProp).booleanValue();
boolean wantNative = Boolean.parseBoolean(wantedProp);
if (wantNative) {
boolean loaded = loadGeneric();
if (loaded) {

View File

@ -219,7 +219,7 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
// auto-add auth if required, not set in the options, and we are not in the same JVM
if ((!_context.isRouterContext()) &&
Boolean.valueOf(_context.getProperty("i2cp.auth")).booleanValue() &&
_context.getBooleanProperty("i2cp.auth") &&
((!options.containsKey("i2cp.username")) || (!options.containsKey("i2cp.password")))) {
String configUser = _context.getProperty("i2cp.username");
String configPW = _context.getProperty("i2cp.password");
@ -349,7 +349,7 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
_queue = mgr.connect();
_reader = new QueuedI2CPMessageReader(_queue, this);
} else {
if (Boolean.valueOf(_options.getProperty(PROP_ENABLE_SSL)).booleanValue())
if (Boolean.parseBoolean(_options.getProperty(PROP_ENABLE_SSL)))
_socket = I2CPSSLSocketFactory.createSocket(_context, _hostname, _portNum);
else
_socket = new Socket(_hostname, _portNum);
@ -976,8 +976,8 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
private void startIdleMonitor() {
_isReduced = false;
boolean reduce = Boolean.valueOf(_options.getProperty("i2cp.reduceOnIdle")).booleanValue();
boolean close = Boolean.valueOf(_options.getProperty("i2cp.closeOnIdle")).booleanValue();
boolean reduce = Boolean.parseBoolean(_options.getProperty("i2cp.reduceOnIdle"));
boolean close = Boolean.parseBoolean(_options.getProperty("i2cp.closeOnIdle"));
if (reduce || close) {
updateActivity();
_context.simpleScheduler().addEvent(new SessionIdleTimer(_context, this, reduce, close), SessionIdleTimer.MINIMUM_TIME);

View File

@ -111,7 +111,7 @@ class I2PSessionImpl2 extends I2PSessionImpl {
return false;
String p = getOptions().getProperty("i2cp.gzip");
if (p != null)
return Boolean.valueOf(p).booleanValue();
return Boolean.parseBoolean(p);
return SHOULD_COMPRESS;
}

View File

@ -63,7 +63,7 @@ class I2PSimpleSession extends I2PSessionImpl2 {
_queue = mgr.connect();
_reader = new QueuedI2CPMessageReader(_queue, this);
} else {
if (Boolean.valueOf(getOptions().getProperty(PROP_ENABLE_SSL)).booleanValue())
if (Boolean.parseBoolean(getOptions().getProperty(PROP_ENABLE_SSL)))
_socket = I2CPSSLSocketFactory.createSocket(_context, _hostname, _portNum);
else
_socket = new Socket(_hostname, _portNum);

View File

@ -74,7 +74,7 @@ class RequestLeaseSetMessageHandler extends HandlerImpl {
leaseSet.setEncryptionKey(li.getPublicKey());
leaseSet.setSigningKey(li.getSigningPublicKey());
boolean encrypt = Boolean.valueOf(session.getOptions().getProperty("i2cp.encryptLeaseSet")).booleanValue();
boolean encrypt = Boolean.parseBoolean(session.getOptions().getProperty("i2cp.encryptLeaseSet"));
String sk = session.getOptions().getProperty("i2cp.leaseSetKey");
if (encrypt && sk != null) {
SessionKey key = new SessionKey();

View File

@ -449,7 +449,7 @@ public class NativeBigInteger extends BigInteger {
private static final void loadNative() {
try{
String wantedProp = System.getProperty("jbigi.enable", "true");
boolean wantNative = Boolean.valueOf(wantedProp).booleanValue();
boolean wantNative = Boolean.parseBoolean(wantedProp);
if (wantNative) {
debug("trying loadGeneric");
boolean loaded = loadGeneric("jbigi");

View File

@ -91,7 +91,7 @@ public class Blocklist {
static final String BLOCKLIST_FILE_DEFAULT = "blocklist.txt";
public void startup() {
if (! Boolean.valueOf(_context.getProperty(PROP_BLOCKLIST_ENABLED, "true")).booleanValue())
if (! _context.getBooleanPropertyDefaultTrue(PROP_BLOCKLIST_ENABLED))
return;
String file = _context.getProperty(PROP_BLOCKLIST_FILE, BLOCKLIST_FILE_DEFAULT);
// Maybe someday we'll read in multiple files and merge them

View File

@ -348,7 +348,7 @@ public class InNetMessagePool implements Service {
_dispatchThreaded = DEFAULT_DISPATCH_THREADED;
String threadedStr = _context.getProperty(PROP_DISPATCH_THREADED);
if (threadedStr != null) {
_dispatchThreaded = Boolean.valueOf(threadedStr).booleanValue();
_dispatchThreaded = Boolean.parseBoolean(threadedStr);
}
if (_dispatchThreaded) {
_context.statManager().createRateStat("pool.dispatchDataTime", "How long a tunnel dispatch takes", "Tunnels", new long[] { 10*60*1000l, 60*60*1000l, 24*60*60*1000l });

View File

@ -80,7 +80,7 @@ public class MessageHistory {
String getFilename() { return _historyFile; }
private void updateSettings() {
_doLog = Boolean.valueOf(_context.getProperty(PROP_KEEP_MESSAGE_HISTORY)).booleanValue();
_doLog = _context.getBooleanProperty(PROP_KEEP_MESSAGE_HISTORY);
_historyFile = _context.getProperty(PROP_MESSAGE_HISTORY_FILENAME, DEFAULT_MESSAGE_HISTORY_FILENAME);
}

View File

@ -176,7 +176,7 @@ public class Router implements RouterClock.ClockShiftListener {
// Do we copy all the data files to the new directory? default false
String migrate = System.getProperty("i2p.dir.migrate");
boolean migrateFiles = Boolean.valueOf(migrate).booleanValue();
boolean migrateFiles = Boolean.parseBoolean(migrate);
String userDir = WorkingDir.getWorkingDir(envProps, migrateFiles);
// Use the router.config file specified in the router.configLocation property
@ -196,7 +196,7 @@ public class Router implements RouterClock.ClockShiftListener {
envProps.putAll(_config);
// This doesn't work, guess it has to be in the static block above?
// if (Boolean.valueOf(envProps.getProperty("router.disableIPv6")).booleanValue())
// if (Boolean.parseBoolean(envProps.getProperty("router.disableIPv6")))
// System.setProperty("java.net.preferIPv4Stack", "true");
if (envProps.getProperty("i2p.dir.config") == null)
@ -630,7 +630,7 @@ public class Router implements RouterClock.ClockShiftListener {
return true;
String h = _context.getProperty(PROP_HIDDEN_HIDDEN);
if (h != null)
return Boolean.valueOf(h).booleanValue();
return Boolean.parseBoolean(h);
return _context.commSystem().isInBadCountry();
}

View File

@ -237,7 +237,7 @@ public class TunnelPoolSettings {
private static final boolean getBoolean(String str, boolean defaultValue) {
if (str == null) return defaultValue;
boolean v = Boolean.valueOf(str).booleanValue() ||
boolean v = Boolean.parseBoolean(str) ||
(str != null && "YES".equals(str.toUpperCase(Locale.US)));
return v;
}

View File

@ -326,7 +326,7 @@ class ClientManager {
if (destHash == null) return true;
ClientConnectionRunner runner = getRunner(destHash);
if (runner == null) return true;
return !Boolean.valueOf(runner.getConfig().getOptions().getProperty(ClientManagerFacade.PROP_CLIENT_ONLY)).booleanValue();
return !Boolean.parseBoolean(runner.getConfig().getOptions().getProperty(ClientManagerFacade.PROP_CLIENT_ONLY));
}
/**

View File

@ -169,7 +169,7 @@ class ClientMessageEventListener implements I2CPMessageReader.I2CPMessageEventLi
}
// Auth, since 0.8.2
if (_enforceAuth && Boolean.valueOf(_context.getProperty("i2cp.auth")).booleanValue()) {
if (_enforceAuth && _context.getBooleanProperty("i2cp.auth")) {
String configUser = _context.getProperty("i2cp.username");
String configPW = _context.getProperty("i2cp.password");
if (configUser != null && configPW != null) {

View File

@ -452,7 +452,7 @@ public class OutboundClientMessageOneShotJob extends JobImpl {
// Per-message flag == false overrides session option which is default true
String allow = _clientMessage.getSenderConfig().getOptions().getProperty(BUNDLE_REPLY_LEASESET);
boolean allowLeaseBundle = SendMessageOptions.getSendLeaseSet(sendFlags) &&
(allow == null || Boolean.valueOf(allow).booleanValue());
(allow == null || Boolean.parseBoolean(allow));
if (allowLeaseBundle) {
// If we want an ack, bundle a leaseSet...
//replyLeaseSet = getReplyLeaseSet(wantACK);

View File

@ -45,7 +45,7 @@ class HarvesterJob extends JobImpl {
public static final String PROP_ENABLED = "netDb.shouldHarvest";
private boolean harvestDirectly() {
return Boolean.valueOf(getContext().getProperty("netDb.harvestDirectly", "false")).booleanValue();
return getContext().getBooleanProperty("netDb.harvestDirectly");
}
public HarvesterJob(RouterContext context, KademliaNetworkDatabaseFacade facade) {

View File

@ -220,7 +220,7 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
}
String enforce = _context.getProperty(PROP_ENFORCE_NETID);
if (enforce != null)
_enforceNetId = Boolean.valueOf(enforce).booleanValue();
_enforceNetId = Boolean.parseBoolean(enforce);
else
_enforceNetId = DEFAULT_ENFORCE_NETID;
_ds.restart();
@ -246,7 +246,7 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
String dbDir = _context.getProperty(PROP_DB_DIR, DEFAULT_DB_DIR);
String enforce = _context.getProperty(PROP_ENFORCE_NETID);
if (enforce != null)
_enforceNetId = Boolean.valueOf(enforce).booleanValue();
_enforceNetId = Boolean.parseBoolean(enforce);
else
_enforceNetId = DEFAULT_ENFORCE_NETID;

View File

@ -136,7 +136,7 @@ class SearchJob extends JobImpl {
// Returning false essentially enables kademlia as a backup to floodfill for search responses.
if (FloodfillNetworkDatabaseFacade.floodfillEnabled(ctx))
return false;
return Boolean.valueOf(ctx.getProperty("netDb.floodfillOnly", DEFAULT_FLOODFILL_ONLY + "")).booleanValue();
return ctx.getProperty("netDb.floodfillOnly", DEFAULT_FLOODFILL_ONLY);
}
/***

View File

@ -527,7 +527,7 @@ public class Reseeder {
/******
public static void main(String args[]) {
if ( (args != null) && (args.length == 1) && (!Boolean.valueOf(args[0]).booleanValue()) ) {
if ( (args != null) && (args.length == 1) && (!Boolean.parseBoolean(args[0])) ) {
System.out.println("Not reseeding, as requested");
return; // not reseeding on request
}

View File

@ -54,7 +54,7 @@ public class BootCommSystemJob extends JobImpl {
private void startupDb() {
Job bootDb = new BootNetworkDbJob(getContext());
boolean useTrusted = Boolean.valueOf(getContext().getProperty(PROP_USE_TRUSTED_LINKS)).booleanValue();
boolean useTrusted = getContext().getBooleanProperty(PROP_USE_TRUSTED_LINKS);
if (useTrusted) {
_log.debug("Using trusted links...");
getContext().jobQueue().addJob(new BuildTrustedLinksJob(getContext(), bootDb));

View File

@ -64,7 +64,7 @@ public class RouterWatchdog implements Runnable {
private boolean shutdownOnHang() {
// prop default false
if (!Boolean.valueOf(_context.getProperty("watchdog.haltOnHang")).booleanValue())
if (!_context.getBooleanProperty("watchdog.haltOnHang"))
return false;
// Client manager starts complaining after 10 minutes, and we run every minute,

View File

@ -72,7 +72,7 @@ public class RouterTimestamper extends Timestamper {
// so the property must be set at startup.
// We still need to be instantiated since the router calls clock().getTimestamper().waitForInitialization()
String disabled = ctx.getProperty(PROP_DISABLED, DEFAULT_DISABLED);
if (Boolean.valueOf(disabled).booleanValue()) {
if (Boolean.parseBoolean(disabled)) {
_initialized = true;
return;
}
@ -321,7 +321,7 @@ public class RouterTimestamper extends Timestamper {
_context.getProperty(PROP_QUERY_FREQUENCY, DEFAULT_QUERY_FREQUENCY));
String disabled = _context.getProperty(PROP_DISABLED, DEFAULT_DISABLED);
_disabled = Boolean.valueOf(disabled).booleanValue();
_disabled = Boolean.parseBoolean(disabled);
_concurringServers = Math.min(4, Math.max(1,
_context.getProperty(PROP_CONCURRING_SERVERS, DEFAULT_CONCURRING_SERVERS)));

View File

@ -331,7 +331,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
if (_log.shouldLog(Log.INFO))
_log.info("old: " + ohost + " config: " + name + " auto: " + enabled + " status: " + status);
if (enabled.equals("always") ||
(Boolean.valueOf(enabled).booleanValue() && status == STATUS_OK)) {
(Boolean.parseBoolean(enabled) && status == STATUS_OK)) {
String nhost = UDPAddr.getOption(UDPAddress.PROP_HOST);
if (_log.shouldLog(Log.INFO))
_log.info("old: " + ohost + " config: " + name + " new: " + nhost);
@ -354,7 +354,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
changed = true;
} else if (ohost == null || ohost.length() <= 0) {
return;
} else if (Boolean.valueOf(enabled).booleanValue() && status != STATUS_OK) {
} else if (Boolean.parseBoolean(enabled) && 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

@ -91,7 +91,7 @@ class GeoIP {
*/
/******
public void lookup() {
if (! Boolean.valueOf(_context.getProperty(PROP_GEOIP_ENABLED, "true")).booleanValue()) {
if (! _context.getBooleanPropertyDefaultTrue(PROP_GEOIP_ENABLED)) {
_pendingSearch.clear();
return;
}
@ -105,7 +105,7 @@ class GeoIP {
* Results will be added to the table and available via get() after completion.
*/
public void blockingLookup() {
if (! Boolean.valueOf(_context.getProperty(PROP_GEOIP_ENABLED, "true")).booleanValue()) {
if (! _context.getBooleanPropertyDefaultTrue(PROP_GEOIP_ENABLED)) {
_pendingSearch.clear();
return;
}

View File

@ -362,7 +362,7 @@ public class TransportManager implements TransportEventListener {
}
// Use UDP port for NTCP too - see comment in NTCPTransport.getRequestedPort() for why this is here
if (t.getStyle().equals(NTCPTransport.STYLE) && port <= 0 &&
Boolean.valueOf(_context.getProperty(CommSystemFacadeImpl.PROP_I2NP_NTCP_AUTO_PORT)).booleanValue()) {
_context.getBooleanProperty(CommSystemFacadeImpl.PROP_I2NP_NTCP_AUTO_PORT)) {
Transport udp = getTransport(UDPTransport.STYLE);
if (udp != null)
port = t.getRequestedPort();

View File

@ -708,7 +708,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
private boolean getIsPortFixed() {
String prop = _context.getProperty(PROP_FIXED_PORT);
if (prop != null)
return Boolean.valueOf(prop).booleanValue();
return Boolean.parseBoolean(prop);
int status = getReachabilityStatus();
return status != CommSystemFacade.STATUS_REJECT_UNSOLICITED;
}
@ -1503,7 +1503,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
* it's usually false positives.
******************
String forceIntroducers = _context.getProperty(PROP_FORCE_INTRODUCERS);
if ( (forceIntroducers != null) && (Boolean.valueOf(forceIntroducers).booleanValue()) ) {
if ( (forceIntroducers != null) && (Boolean.parseBoolean(forceIntroducers)) ) {
if (_log.shouldLog(Log.INFO))
_log.info("Force introducers specified");
return true;

View File

@ -460,7 +460,7 @@ public abstract class TunnelPeerSelector {
else
val = ctx.getProperty(PROP_OUTBOUND_CLIENT_EXCLUDE_UNREACHABLE, DEFAULT_OUTBOUND_CLIENT_EXCLUDE_UNREACHABLE);
boolean rv = (val != null ? Boolean.valueOf(val).booleanValue() : def);
boolean rv = (val != null ? Boolean.parseBoolean(val) : def);
//System.err.println("Filter unreachable? " + rv + " (inbound? " + isInbound + ", exploratory? " + isExploratory);
return rv;
}
@ -490,7 +490,7 @@ public abstract class TunnelPeerSelector {
else
val = ctx.getProperty(PROP_OUTBOUND_CLIENT_EXCLUDE_SLOW);
boolean rv = (val != null ? Boolean.valueOf(val).booleanValue() : def);
boolean rv = (val != null ? Boolean.parseBoolean(val) : def);
//System.err.println("Filter unreachable? " + rv + " (inbound? " + isInbound + ", exploratory? " + isExploratory);
return rv;
}
@ -519,7 +519,7 @@ public abstract class TunnelPeerSelector {
else
val = ctx.getProperty(PROP_OUTBOUND_CLIENT_EXCLUDE_UPTIME);
boolean rv = (val != null ? Boolean.valueOf(val).booleanValue() : def);
boolean rv = (val != null ? Boolean.parseBoolean(val) : def);
//System.err.println("Filter unreachable? " + rv + " (inbound? " + isInbound + ", exploratory? " + isExploratory);
return rv;
}