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

@@ -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");