forked from I2P_Developers/i2p.i2p
findbugs correctness fixes, all over the place
This commit is contained in:
@@ -197,6 +197,9 @@ public class TunnelPoolSettings {
|
||||
|
||||
public Properties getUnknownOptions() { return _unknownOptions; }
|
||||
|
||||
/**
|
||||
* @param prefix non-null
|
||||
*/
|
||||
public void readFromProperties(String prefix, Map<Object, Object> props) {
|
||||
for (Map.Entry e : props.entrySet()) {
|
||||
String name = (String) e.getKey();
|
||||
@@ -225,11 +228,14 @@ public class TunnelPoolSettings {
|
||||
int max = _isExploratory ? EXPLORATORY_PRIORITY : MAX_PRIORITY;
|
||||
_priority = Math.min(max, Math.max(MIN_PRIORITY, getInt(value, def)));
|
||||
} else
|
||||
_unknownOptions.setProperty(name.substring((prefix != null ? prefix.length() : 0)), value);
|
||||
_unknownOptions.setProperty(name.substring(prefix.length()), value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param prefix non-null
|
||||
*/
|
||||
public void writeToProperties(String prefix, Properties props) {
|
||||
if (props == null) return;
|
||||
props.setProperty(prefix + PROP_ALLOW_ZERO_HOP, ""+_allowZeroHop);
|
||||
|
@@ -320,10 +320,12 @@ class BuildExecutor implements Runnable {
|
||||
// we don't have either inbound or outbound tunnels, so don't bother trying to build
|
||||
// non-zero-hop tunnels
|
||||
// try to kickstart it to build a fallback, otherwise we may get stuck here for a long time (minutes)
|
||||
if (mgr.getFreeTunnelCount() <= 0)
|
||||
mgr.selectInboundTunnel();
|
||||
if (mgr.getOutboundTunnelCount() <= 0)
|
||||
mgr.selectOutboundTunnel();
|
||||
if (mgr != null) {
|
||||
if (mgr.getFreeTunnelCount() <= 0)
|
||||
mgr.selectInboundTunnel();
|
||||
if (mgr.getOutboundTunnelCount() <= 0)
|
||||
mgr.selectOutboundTunnel();
|
||||
}
|
||||
synchronized (_currentlyBuilding) {
|
||||
if (!_repoll) {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
|
@@ -261,7 +261,7 @@ public class TunnelPool {
|
||||
}
|
||||
}
|
||||
if (rv != null) {
|
||||
_context.statManager().addRateData("tunnel.matchLease", closestTo.equals(rv) ? 1 : 0);
|
||||
_context.statManager().addRateData("tunnel.matchLease", closestTo.equals(rv.getFarEnd()) ? 1 : 0);
|
||||
} else {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn(toString() + ": No tunnels to select from");
|
||||
|
Reference in New Issue
Block a user