More cleanups

This commit is contained in:
str4d
2013-11-27 01:42:34 +00:00
parent 4ee144533a
commit 9d7ee30c15
3 changed files with 10 additions and 10 deletions

View File

@ -18,7 +18,6 @@ import java.net.Socket;
import java.net.UnknownHostException;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
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 */
private Properties filter(Properties options) {
Properties rv = new Properties();
for (Iterator iter = options.keySet().iterator(); iter.hasNext();) {
String key = (String) iter.next();
for (Object oKey : options.keySet()) { // TODO-Java6: s/keySet()/stringPropertyNames()/
String key = (String) oKey;
if (key.startsWith("java.") ||
key.startsWith("user.") ||
key.startsWith("os.") ||

View File

@ -497,10 +497,10 @@ public class DataHelper {
* Pretty print the collection
*
*/
public static String toString(Collection col) {
public static String toString(Collection<?> col) {
StringBuilder buf = new StringBuilder();
if (col != null) {
for (Iterator iter = col.iterator(); iter.hasNext();) {
for (Iterator<?> iter = col.iterator(); iter.hasNext();) {
Object o = iter.next();
buf.append("[").append(o).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.
*
*/
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 false;
if (lhs.size() != rhs.size()) return false;
Iterator liter = lhs.iterator();
Iterator riter = rhs.iterator();
Iterator<?> liter = lhs.iterator();
Iterator<?> riter = rhs.iterator();
while ((liter.hasNext()) && (riter.hasNext()))
if (!(eq(liter.next(), riter.next()))) return false;
return true;
@ -1132,10 +1132,10 @@ public class DataHelper {
* 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;
int c = 0;
for (Iterator iter = col.iterator(); iter.hasNext();)
for (Iterator<?> iter = col.iterator(); iter.hasNext();)
c = 7 * c + hashCode(iter.next());
return c;
}

View File

@ -384,6 +384,7 @@ public class EepGet {
fmt.format("%7.2f", Double.valueOf(lifetimeKBps));
buf.append(" KBps");
System.out.println(buf.toString());
fmt.close();
}
_lastComplete = now;
}