propagate from branch 'i2p.i2p.str4d.cleanup' (head 736423cc308e964bab55068e625f8a1852932ec5)

to branch 'i2p.i2p' (head 0ac335d5dc4ccaeb113af4fb5c0e993a6f42fdbe)
This commit is contained in:
str4d
2013-12-09 19:51:39 +00:00
113 changed files with 396 additions and 577 deletions

View File

@@ -366,7 +366,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
* @since 0.9.1
*/
public void setClientOptions(Properties opts) {
for (Iterator iter = _clientOptions.keySet().iterator(); iter.hasNext();) {
for (Iterator<Object> iter = _clientOptions.keySet().iterator(); iter.hasNext();) {
Object key = iter.next();
if (!opts.containsKey(key))
iter.remove();
@@ -1667,8 +1667,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
*/
void routerDisconnected() {
_log.error(getPrefix() + "Router disconnected - firing notification events");
for (Iterator<ConnectionEventListener> iter = listeners.iterator(); iter.hasNext();) {
ConnectionEventListener lsnr = iter.next();
for (ConnectionEventListener lsnr : listeners) {
if (lsnr != null) lsnr.routerDisconnected();
}
}

View File

@@ -16,7 +16,6 @@ import java.net.Socket;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.security.GeneralSecurityException;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
@@ -320,8 +319,8 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
synchronized (lock) {
if (!forced && sockMgr.listSockets().size() != 0) {
l.log("There are still active connections!");
for (Iterator<I2PSocket> it = sockMgr.listSockets().iterator(); it.hasNext();) {
l.log("->" + it.next());
for (I2PSocket skt : sockMgr.listSockets()) {
l.log("->" + skt);
}
return false;
}
@@ -365,7 +364,7 @@ public class I2PTunnelServer extends I2PTunnelTask implements Runnable {
*/
private void buildSocketMap(Properties props) {
_socketMap.clear();
for (Map.Entry e : props.entrySet()) {
for (Map.Entry<Object, Object> e : props.entrySet()) {
String key = (String) e.getKey();
if (key.startsWith("targetForPort.")) {
key = key.substring("targetForPort.".length());

View File

@@ -413,7 +413,7 @@ public class TunnelController implements Logging {
*/
public Properties getClientOptionProps() {
Properties opts = new Properties();
for (Map.Entry e : _config.entrySet()) {
for (Map.Entry<Object, Object> e : _config.entrySet()) {
String key = (String) e.getKey();
if (key.startsWith("option.")) {
key = key.substring("option.".length());
@@ -471,7 +471,7 @@ public class TunnelController implements Logging {
*/
public void setConfig(Properties config, String prefix) {
Properties props = new Properties();
for (Map.Entry e : config.entrySet()) {
for (Map.Entry<Object, Object> e : config.entrySet()) {
String key = (String) e.getKey();
if (key.startsWith(prefix)) {
key = key.substring(prefix.length());
@@ -516,7 +516,7 @@ public class TunnelController implements Logging {
*/
public Properties getConfig(String prefix) {
Properties rv = new Properties();
for (Map.Entry e : _config.entrySet()) {
for (Map.Entry<Object, Object> e : _config.entrySet()) {
String key = (String) e.getKey();
String val = (String) e.getValue();
rv.setProperty(prefix + key, val);
@@ -538,7 +538,7 @@ public class TunnelController implements Logging {
*/
public String getClientOptions() {
StringBuilder opts = new StringBuilder(64);
for (Map.Entry e : _config.entrySet()) {
for (Map.Entry<Object, Object> e : _config.entrySet()) {
String key = (String) e.getKey();
if (key.startsWith("option.")) {
key = key.substring("option.".length());

View File

@@ -70,7 +70,7 @@ public class I2PSOCKSTunnel extends I2PTunnelClientBase {
private void parseOptions() {
Properties opts = getTunnel().getClientOptions();
proxies = new HashMap<String, List<String>>(1);
for (Map.Entry e : opts.entrySet()) {
for (Map.Entry<Object, Object> e : opts.entrySet()) {
String prop = (String)e.getKey();
if ((!prop.startsWith(PROP_PROXY_PREFIX)) || prop.length() <= PROP_PROXY_PREFIX.length())
continue;

View File

@@ -373,7 +373,7 @@ public class EditBean extends IndexBean {
boolean isMD5Proxy = "httpclient".equals(tun.getType()) ||
"connectclient".equals(tun.getType());
Map<String, String> sorted = new TreeMap<String, String>();
for (Map.Entry e : opts.entrySet()) {
for (Map.Entry<Object, Object> e : opts.entrySet()) {
String key = (String)e.getKey();
if (_noShowSet.contains(key))
continue;