forked from I2P_Developers/i2p.i2p
less wtf
This commit is contained in:
@ -866,7 +866,7 @@ public class KRPC implements I2PSessionMuxedListener, DHT {
|
||||
@SuppressWarnings("unchecked")
|
||||
private ReplyWaiter sendQuery(NodeInfo nInfo, Map<String, Object> map, boolean repliable) {
|
||||
if (nInfo.equals(_myNodeInfo))
|
||||
throw new IllegalArgumentException("wtf don't send to ourselves");
|
||||
throw new IllegalArgumentException("don't send to ourselves");
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Sending query to: " + nInfo);
|
||||
if (nInfo.getDestination() == null) {
|
||||
@ -916,7 +916,7 @@ public class KRPC implements I2PSessionMuxedListener, DHT {
|
||||
@SuppressWarnings("unchecked")
|
||||
private boolean sendResponse(NodeInfo nInfo, MsgID msgID, Map<String, Object> map) {
|
||||
if (nInfo.equals(_myNodeInfo))
|
||||
throw new IllegalArgumentException("wtf don't send to ourselves");
|
||||
throw new IllegalArgumentException("don't send to ourselves");
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Sending response to: " + nInfo);
|
||||
if (nInfo.getDestination() == null) {
|
||||
@ -946,7 +946,7 @@ public class KRPC implements I2PSessionMuxedListener, DHT {
|
||||
*/
|
||||
private boolean sendError(NodeInfo nInfo, MsgID msgID, Map<String, Object> map) {
|
||||
if (nInfo.equals(_myNodeInfo))
|
||||
throw new IllegalArgumentException("wtf don't send to ourselves");
|
||||
throw new IllegalArgumentException("don't send to ourselves");
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Sending error to: " + nInfo);
|
||||
if (nInfo.getDestination() == null) {
|
||||
@ -1004,7 +1004,7 @@ public class KRPC implements I2PSessionMuxedListener, DHT {
|
||||
return false;
|
||||
}
|
||||
if (dest.calculateHash().equals(_myNodeInfo.getHash()))
|
||||
throw new IllegalArgumentException("wtf don't send to ourselves");
|
||||
throw new IllegalArgumentException("don't send to ourselves");
|
||||
byte[] payload = BEncoder.bencode(map);
|
||||
if (_log.shouldLog(Log.DEBUG)) {
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(payload);
|
||||
@ -1020,7 +1020,7 @@ public class KRPC implements I2PSessionMuxedListener, DHT {
|
||||
payload = dgMaker.makeI2PDatagram(payload);
|
||||
if (payload == null) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("WTF DGM fail");
|
||||
_log.warn("DGM fail");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1040,7 +1040,7 @@ public class KRPC implements I2PSessionMuxedListener, DHT {
|
||||
_txBytes.addAndGet(payload.length);
|
||||
} else {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("WTF sendMessage fail");
|
||||
_log.warn("sendMessage fail");
|
||||
}
|
||||
return success;
|
||||
} catch (I2PSessionException ise) {
|
||||
|
@ -64,7 +64,7 @@ abstract class IRCFilter {
|
||||
idx++;
|
||||
command = field[idx++].toUpperCase(Locale.US);
|
||||
} catch (IndexOutOfBoundsException ioobe) {
|
||||
// wtf, server sent borked command?
|
||||
// server sent borked command?
|
||||
//_log.warn("Dropping defective message: index out of bounds while extracting command.");
|
||||
return null;
|
||||
}
|
||||
@ -282,7 +282,7 @@ abstract class IRCFilter {
|
||||
|
||||
|
||||
if(field[0].charAt(0)==':')
|
||||
return null; // wtf
|
||||
return null; // ???
|
||||
|
||||
String command = field[0].toUpperCase(Locale.US);
|
||||
|
||||
|
@ -168,7 +168,7 @@ class SOCKS5Server extends SOCKSServer {
|
||||
private int manageRequest(DataInputStream in, DataOutputStream out) throws IOException, SOCKSException {
|
||||
int socksVer = in.readUnsignedByte();
|
||||
if (socksVer != SOCKS_VERSION_5) {
|
||||
_log.debug("error in SOCKS5 request (protocol != 5? wtf?)");
|
||||
_log.debug("error in SOCKS5 request (protocol != 5?)");
|
||||
throw new SOCKSException("Invalid protocol version in request: " + socksVer);
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ class SOCKS5Server extends SOCKSServer {
|
||||
{
|
||||
int addrLen = in.readUnsignedByte();
|
||||
if (addrLen == 0) {
|
||||
_log.debug("0-sized address length? wtf?");
|
||||
_log.debug("0-sized address length?");
|
||||
throw new SOCKSException("Illegal DOMAINNAME length");
|
||||
}
|
||||
byte addr[] = new byte[addrLen];
|
||||
@ -315,7 +315,7 @@ class SOCKS5Server extends SOCKSServer {
|
||||
dreps.writeBytes(domainName);
|
||||
break;
|
||||
default:
|
||||
_log.error("unknown address type passed to sendReply() (" + Integer.toHexString(addressType) + ")! wtf?");
|
||||
_log.error("unknown address type passed to sendReply() (" + Integer.toHexString(addressType) + ")!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ public class TestSwarm {
|
||||
flooder.closed();
|
||||
_log.debug("Connection " + flooder.getConnectionId() + " closed to " + flooder.getDestination());
|
||||
} else {
|
||||
_log.error("wtf, not connected to " + id + " but we were just closed?");
|
||||
_log.error("not connected to " + id + " but we were just closed?");
|
||||
}
|
||||
}
|
||||
public void streamDataReceived(int id, byte data[], int offset, int length) {
|
||||
@ -109,7 +109,7 @@ public class TestSwarm {
|
||||
if (flooder != null) {
|
||||
flooder.received(length, value);
|
||||
} else {
|
||||
_log.error("wtf, not connected to " + id + " but we received " + value + "?");
|
||||
_log.error("not connected to " + id + " but we received " + value + "?");
|
||||
}
|
||||
}
|
||||
public void streamConnectedReceived(String dest, int id) {
|
||||
@ -146,7 +146,7 @@ public class TestSwarm {
|
||||
String serverVersion = _eventHandler.waitForHelloReply();
|
||||
_log.debug("Hello reply found: " + serverVersion);
|
||||
if (serverVersion == null)
|
||||
throw new IOException("wtf, hello failed?");
|
||||
throw new IOException("hello failed?");
|
||||
String req = "SESSION CREATE STYLE=STREAM DESTINATION=" + _destFile + " " + _conOptions + "\n";
|
||||
_samOut.write(DataHelper.getUTF8(req));
|
||||
_samOut.flush();
|
||||
|
@ -1136,7 +1136,7 @@ class Connection {
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("Inactivity timeout reached, but there are unacked packets");
|
||||
return;
|
||||
}
|
||||
// wtf, this shouldn't have been scheduled
|
||||
// this shouldn't have been scheduled
|
||||
if (_options.getInactivityTimeout() <= 0) {
|
||||
if (_log.shouldLog(Log.DEBUG)) _log.debug("Inactivity timeout reached, but there is no timer...");
|
||||
return;
|
||||
|
@ -140,9 +140,9 @@ class ConnectionDataReceiver implements MessageOutputStream.DataReceiver {
|
||||
//long sent = System.currentTimeMillis();
|
||||
|
||||
//if ( (built-before > 5*1000) && (_log.shouldLog(Log.WARN)) )
|
||||
// _log.warn("wtf, took " + (built-before) + "ms to build a packet: " + packet);
|
||||
// _log.warn(took " + (built-before) + "ms to build a packet: " + packet);
|
||||
//if ( (sent-built> 5*1000) && (_log.shouldLog(Log.WARN)) )
|
||||
// _log.warn("wtf, took " + (sent-built) + "ms to send a packet: " + packet);
|
||||
// _log.warn(took " + (sent-built) + "ms to send a packet: " + packet);
|
||||
return packet;
|
||||
}
|
||||
|
||||
|
@ -542,7 +542,7 @@ class ConnectionPacketHandler {
|
||||
}
|
||||
} else {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Received a packet for the wrong connection? wtf: "
|
||||
_log.warn("Received a packet for the wrong connection? "
|
||||
+ con + " / " + packet);
|
||||
return;
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ class MessageOutputStream extends OutputStream {
|
||||
}
|
||||
long elapsed = _context.clock().now() - begin;
|
||||
if ( (elapsed > 10*1000) && (_log.shouldLog(Log.INFO)) )
|
||||
_log.info("wtf, took " + elapsed + "ms to write to the stream?", new Exception("foo"));
|
||||
_log.info("took " + elapsed + "ms to write to the stream?", new Exception("foo"));
|
||||
throwAnyError();
|
||||
//updateBps(len);
|
||||
}
|
||||
@ -374,7 +374,7 @@ class MessageOutputStream extends OutputStream {
|
||||
|
||||
long elapsed = _context.clock().now() - begin;
|
||||
if ( (elapsed > 10*1000) && (_log.shouldLog(Log.DEBUG)) )
|
||||
_log.debug("wtf, took " + elapsed + "ms to flush the stream?\n" + ws, new Exception("bar"));
|
||||
_log.debug("took " + elapsed + "ms to flush the stream?\n" + ws, new Exception("bar"));
|
||||
throwAnyError();
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ public final class CryptixAESEngine extends AESEngine {
|
||||
sessionKey.setPreparedKey(key);
|
||||
} catch (InvalidKeyException ike) {
|
||||
_log.log(Log.CRIT, "Invalid key", ike);
|
||||
throw new IllegalArgumentException("wtf, invalid key? " + ike.getMessage());
|
||||
throw new IllegalArgumentException("invalid key? " + ike.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ public final class CryptixAESEngine extends AESEngine {
|
||||
sessionKey.setPreparedKey(key);
|
||||
} catch (InvalidKeyException ike) {
|
||||
_log.log(Log.CRIT, "Invalid key", ike);
|
||||
throw new IllegalArgumentException("wtf, invalid key? " + ike.getMessage());
|
||||
throw new IllegalArgumentException("invalid key? " + ike.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -493,7 +493,7 @@ riCe6OlAEiNpcc6mMyIYYWFICbrDFTrDR3wXqwc/Jkcx6L5VVWoagpSzbo3yGhc=
|
||||
|
||||
return new String(data, "UTF-8");
|
||||
} catch (UnsupportedEncodingException uee) {
|
||||
throw new RuntimeException("wtf, your JVM doesnt support utf-8? " + uee.getMessage());
|
||||
throw new RuntimeException("your JVM doesnt support utf-8? " + uee.getMessage());
|
||||
} catch (IOException ioe) {
|
||||
return "";
|
||||
} finally {
|
||||
@ -532,7 +532,7 @@ riCe6OlAEiNpcc6mMyIYYWFICbrDFTrDR3wXqwc/Jkcx6L5VVWoagpSzbo3yGhc=
|
||||
|
||||
return new String(data, "UTF-8");
|
||||
} catch (UnsupportedEncodingException uee) {
|
||||
throw new RuntimeException("wtf, your JVM doesnt support utf-8? " + uee.getMessage());
|
||||
throw new RuntimeException("your JVM doesnt support utf-8? " + uee.getMessage());
|
||||
} catch (IOException ioe) {
|
||||
return "";
|
||||
} finally {
|
||||
@ -746,7 +746,7 @@ riCe6OlAEiNpcc6mMyIYYWFICbrDFTrDR3wXqwc/Jkcx6L5VVWoagpSzbo3yGhc=
|
||||
try {
|
||||
versionRawBytes = version.getBytes("UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException("wtf, your JVM doesnt support utf-8? " + e.getMessage());
|
||||
throw new RuntimeException("your JVM doesnt support utf-8? " + e.getMessage());
|
||||
}
|
||||
|
||||
System.arraycopy(versionRawBytes, 0, versionHeader, 0, versionRawBytes.length);
|
||||
|
@ -661,7 +661,7 @@ public class DataHelper {
|
||||
}
|
||||
|
||||
if (rv < 0)
|
||||
throw new DataFormatException("wtf, fromLong got a negative? " + rv + " numBytes=" + numBytes);
|
||||
throw new DataFormatException("fromLong got a negative? " + rv + " numBytes=" + numBytes);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -753,7 +753,7 @@ public class DataHelper {
|
||||
rv |= src[i] & 0xFF;
|
||||
}
|
||||
if (rv < 0)
|
||||
throw new IllegalArgumentException("wtf, fromLong got a negative? " + rv + ": offset="+ offset +" numBytes="+numBytes);
|
||||
throw new IllegalArgumentException("fromLong got a negative? " + rv + ": offset="+ offset +" numBytes="+numBytes);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -774,7 +774,7 @@ public class DataHelper {
|
||||
rv |= src[i] & 0xFF;
|
||||
}
|
||||
if (rv < 0)
|
||||
throw new IllegalArgumentException("wtf, fromLong got a negative? " + rv + ": offset="+ offset +" numBytes="+numBytes);
|
||||
throw new IllegalArgumentException("fromLong got a negative? " + rv + ": offset="+ offset +" numBytes="+numBytes);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ public class SessionConfig extends DataStructureImpl {
|
||||
}
|
||||
byte data[] = getBytes();
|
||||
if (data == null) {
|
||||
//if (_log.shouldLog(Log.WARN)) _log.warn("Bytes could not be found - wtf?");
|
||||
//if (_log.shouldLog(Log.WARN)) _log.warn("Bytes could not be found");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -432,12 +432,12 @@ public class KBucketSet<T extends SimpleDataStructure> {
|
||||
if (rv >= 0) {
|
||||
return rv;
|
||||
}
|
||||
_log.error("Key does not fit in any bucket?! WTF!\nKey : ["
|
||||
_log.error("Key does not fit in any bucket?!\nKey : ["
|
||||
+ DataHelper.toHexString(key.getData()) + "]"
|
||||
+ "\nUs : " + _us
|
||||
+ "\nDelta: ["
|
||||
+ DataHelper.toHexString(DataHelper.xor(_us.getData(), key.getData()))
|
||||
+ "]", new Exception("WTF"));
|
||||
+ "]", new Exception("???"));
|
||||
_log.error(toString());
|
||||
throw new IllegalStateException("pickBucket returned " + rv);
|
||||
//return -1;
|
||||
@ -588,7 +588,7 @@ public class KBucketSet<T extends SimpleDataStructure> {
|
||||
} else {
|
||||
// dont span main bucket boundaries with depth > 1
|
||||
if (fixed > 0)
|
||||
throw new IllegalStateException("WTF " + bucket);
|
||||
throw new IllegalStateException("??? " + bucket);
|
||||
BigInteger nonz;
|
||||
if (numNonZero <= 62) {
|
||||
// add one to ensure nonzero
|
||||
|
@ -39,7 +39,7 @@ class Executor implements Runnable {
|
||||
}
|
||||
long time = _context.clock().now() - before;
|
||||
if ( (time > 1000) && (_log.shouldLog(Log.WARN)) )
|
||||
_log.warn("wtf, event execution took " + time + ": " + evt);
|
||||
_log.warn("event execution took " + time + ": " + evt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class FortunaRandomSource extends RandomSource implements EntropyHarveste
|
||||
* According to the java docs (http://java.sun.com/j2se/1.4.1/docs/api/java/util/Random.html#nextInt(int))
|
||||
* nextInt(n) should return a number between 0 and n (including 0 and excluding n). However, their pseudocode,
|
||||
* as well as sun's, kaffe's, and classpath's implementation INCLUDES NEGATIVE VALUES.
|
||||
* WTF. Ok, so we're going to have it return between 0 and n (including 0, excluding n), since
|
||||
* Ok, so we're going to have it return between 0 and n (including 0, excluding n), since
|
||||
* thats what it has been used for.
|
||||
*
|
||||
*/
|
||||
|
@ -58,7 +58,7 @@ public class RandomSource extends SecureRandom implements EntropyHarvester {
|
||||
* According to the java docs (http://java.sun.com/j2se/1.4.1/docs/api/java/util/Random.html#nextInt(int))
|
||||
* nextInt(n) should return a number between 0 and n (including 0 and excluding n). However, their pseudocode,
|
||||
* as well as sun's, kaffe's, and classpath's implementation INCLUDES NEGATIVE VALUES.
|
||||
* WTF. Ok, so we're going to have it return between 0 and n (including 0, excluding n), since
|
||||
* Ok, so we're going to have it return between 0 and n (including 0, excluding n), since
|
||||
* thats what it has been used for.
|
||||
*
|
||||
* This code unused, see FortunaRandomSource override
|
||||
|
@ -403,10 +403,10 @@ public class ResettableGZIPInputStream extends InflaterInputStream {
|
||||
throw new RuntimeException("read=" + read + " expected " + orig.length);
|
||||
for (int j = 0; j < read; j++) {
|
||||
if (readBuf[j] != orig[j])
|
||||
throw new RuntimeException("wtf, j=" + j + " readBuf=" + readBuf[j] + " orig=" + orig[j]);
|
||||
throw new RuntimeException("j=" + j + " readBuf=" + readBuf[j] + " orig=" + orig[j]);
|
||||
}
|
||||
boolean ok = (-1 == i.read());
|
||||
if (!ok) throw new RuntimeException("wtf, not EOF after the data?");
|
||||
if (!ok) throw new RuntimeException("not EOF after the data?");
|
||||
//System.out.println("Match ok");
|
||||
// try both closing and not
|
||||
if ((k % 2) != 0)
|
||||
|
@ -170,9 +170,9 @@ public class SimpleScheduler {
|
||||
_log.debug("Running: " + _timedEvent);
|
||||
long before = System.currentTimeMillis();
|
||||
if (_log.shouldLog(Log.WARN) && before < _scheduled - 100)
|
||||
_log.warn(_name + " wtf, early execution " + (_scheduled - before) + ": " + _timedEvent);
|
||||
_log.warn(_name + " early execution " + (_scheduled - before) + ": " + _timedEvent);
|
||||
else if (_log.shouldLog(Log.WARN) && before > _scheduled + 1000)
|
||||
_log.warn(" wtf, late execution " + (before - _scheduled) + ": " + _timedEvent + debug());
|
||||
_log.warn("late execution " + (before - _scheduled) + ": " + _timedEvent + debug());
|
||||
try {
|
||||
_timedEvent.timeReached();
|
||||
} catch (Throwable t) {
|
||||
@ -180,7 +180,7 @@ public class SimpleScheduler {
|
||||
}
|
||||
long time = System.currentTimeMillis() - before;
|
||||
if (time > 1000 && _log.shouldLog(Log.WARN))
|
||||
_log.warn(_name + " wtf, event execution took " + time + ": " + _timedEvent);
|
||||
_log.warn(_name + " event execution took " + time + ": " + _timedEvent);
|
||||
if (_log.shouldLog(Log.INFO)) {
|
||||
// this call is slow - iterates through a HashMap -
|
||||
// would be better to have a local AtomicLong if we care
|
||||
|
@ -173,7 +173,7 @@ public class BSkipLevels<K extends Comparable<? super K>, V> extends SkipLevels<
|
||||
// TODO also check that the level[] array is not out-of-order
|
||||
} else {
|
||||
if (bf.log.shouldLog(Log.WARN))
|
||||
bf.log.warn("WTF " + this + " i = " + i + " of " +
|
||||
bf.log.warn(this + " i = " + i + " of " +
|
||||
lps.length + " / " + levels.length +
|
||||
" valid levels but page is zero");
|
||||
levels[i] = null;
|
||||
|
@ -202,11 +202,11 @@ public class SkipLevels<K extends Comparable<? super K>, V> implements Flushable
|
||||
if((bottom.nKeys == 0) && (sl.first != bottom)) {
|
||||
// from debugging other problems
|
||||
if (res == null) {
|
||||
_log.warn("WTF killing with no return value " + print());
|
||||
_log.warn("killing with no return value " + print());
|
||||
} else if (res[1] == null) {
|
||||
_log.warn("WTF killing with no return value 1 " + print());
|
||||
_log.warn("killing with no return value 1 " + print());
|
||||
} else if (res[1] != this) {
|
||||
_log.warn("WTF killing with return value not us " + res[1] + ' ' + print());
|
||||
_log.warn("killing with return value not us " + res[1] + ' ' + print());
|
||||
}
|
||||
this.killInstance();
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ public class AESInputStream extends FilterInputStream {
|
||||
throw new IOException("Error decrypting - no data to decrypt");
|
||||
|
||||
if (_decryptedSize != 0)
|
||||
throw new IOException("wtf, decrypted size is not 0? " + _decryptedSize);
|
||||
throw new IOException("decrypted size is not 0? " + _decryptedSize);
|
||||
|
||||
_context.aes().decrypt(_encryptedBuf, 0, _encryptedBuf, 0, _key, _lastBlock, BLOCK_SIZE);
|
||||
DataHelper.xor(_encryptedBuf, 0, _lastBlock, 0, _encryptedBuf, 0, BLOCK_SIZE);
|
||||
|
@ -61,7 +61,7 @@ public class BandwidthLimitedOutputStream extends FilterOutputStream {
|
||||
if (src == null) return;
|
||||
if (len <= 0) return;
|
||||
if (len + off > src.length)
|
||||
throw new IllegalArgumentException("wtf are you thinking? len=" + len
|
||||
throw new IllegalArgumentException("what are you thinking? len=" + len
|
||||
+ ", off=" + off + ", data=" + src.length);
|
||||
_currentRequest = _context.bandwidthLimiter().requestOutbound(len, 0, _peerTarget);
|
||||
|
||||
|
Reference in New Issue
Block a user