forked from I2P_Developers/i2p.i2p
More cleanups
This commit is contained in:
@ -18,7 +18,6 @@ import java.net.Socket;
|
|||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.security.GeneralSecurityException;
|
import java.security.GeneralSecurityException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
@ -288,8 +287,8 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
|
|||||||
/** save some memory, don't pass along the pointless properties */
|
/** save some memory, don't pass along the pointless properties */
|
||||||
private Properties filter(Properties options) {
|
private Properties filter(Properties options) {
|
||||||
Properties rv = new Properties();
|
Properties rv = new Properties();
|
||||||
for (Iterator iter = options.keySet().iterator(); iter.hasNext();) {
|
for (Object oKey : options.keySet()) { // TODO-Java6: s/keySet()/stringPropertyNames()/
|
||||||
String key = (String) iter.next();
|
String key = (String) oKey;
|
||||||
if (key.startsWith("java.") ||
|
if (key.startsWith("java.") ||
|
||||||
key.startsWith("user.") ||
|
key.startsWith("user.") ||
|
||||||
key.startsWith("os.") ||
|
key.startsWith("os.") ||
|
||||||
|
@ -497,10 +497,10 @@ public class DataHelper {
|
|||||||
* Pretty print the collection
|
* Pretty print the collection
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static String toString(Collection col) {
|
public static String toString(Collection<?> col) {
|
||||||
StringBuilder buf = new StringBuilder();
|
StringBuilder buf = new StringBuilder();
|
||||||
if (col != null) {
|
if (col != null) {
|
||||||
for (Iterator iter = col.iterator(); iter.hasNext();) {
|
for (Iterator<?> iter = col.iterator(); iter.hasNext();) {
|
||||||
Object o = iter.next();
|
Object o = iter.next();
|
||||||
buf.append("[").append(o).append("]");
|
buf.append("[").append(o).append("]");
|
||||||
if (iter.hasNext()) buf.append(", ");
|
if (iter.hasNext()) buf.append(", ");
|
||||||
@ -964,12 +964,12 @@ public class DataHelper {
|
|||||||
* based on the value of each at each step along the way.
|
* based on the value of each at each step along the way.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final static boolean eq(Collection lhs, Collection rhs) {
|
public final static boolean eq(Collection<?> lhs, Collection<?> rhs) {
|
||||||
if ((lhs == null) && (rhs == null)) return true;
|
if ((lhs == null) && (rhs == null)) return true;
|
||||||
if ((lhs == null) || (rhs == null)) return false;
|
if ((lhs == null) || (rhs == null)) return false;
|
||||||
if (lhs.size() != rhs.size()) return false;
|
if (lhs.size() != rhs.size()) return false;
|
||||||
Iterator liter = lhs.iterator();
|
Iterator<?> liter = lhs.iterator();
|
||||||
Iterator riter = rhs.iterator();
|
Iterator<?> riter = rhs.iterator();
|
||||||
while ((liter.hasNext()) && (riter.hasNext()))
|
while ((liter.hasNext()) && (riter.hasNext()))
|
||||||
if (!(eq(liter.next(), riter.next()))) return false;
|
if (!(eq(liter.next(), riter.next()))) return false;
|
||||||
return true;
|
return true;
|
||||||
@ -1132,10 +1132,10 @@ public class DataHelper {
|
|||||||
* Calculate the hashcode of the collection, using 0 for null
|
* Calculate the hashcode of the collection, using 0 for null
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static int hashCode(Collection col) {
|
public static int hashCode(Collection<?> col) {
|
||||||
if (col == null) return 0;
|
if (col == null) return 0;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
for (Iterator iter = col.iterator(); iter.hasNext();)
|
for (Iterator<?> iter = col.iterator(); iter.hasNext();)
|
||||||
c = 7 * c + hashCode(iter.next());
|
c = 7 * c + hashCode(iter.next());
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
@ -384,6 +384,7 @@ public class EepGet {
|
|||||||
fmt.format("%7.2f", Double.valueOf(lifetimeKBps));
|
fmt.format("%7.2f", Double.valueOf(lifetimeKBps));
|
||||||
buf.append(" KBps");
|
buf.append(" KBps");
|
||||||
System.out.println(buf.toString());
|
System.out.println(buf.toString());
|
||||||
|
fmt.close();
|
||||||
}
|
}
|
||||||
_lastComplete = now;
|
_lastComplete = now;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user