findbugs core,client,crypto,data,stat,i2np

This commit is contained in:
zzz
2011-01-07 00:15:35 +00:00
parent 0129051063
commit 087c7b86de
15 changed files with 76 additions and 51 deletions

View File

@@ -116,7 +116,7 @@ public abstract class I2NPMessageImpl extends DataStructureImpl implements I2NPM
if (!eq)
throw new I2NPMessageException("Hash does not match for " + getClass().getName());
long start = _context.clock().now();
//long start = _context.clock().now();
if (_log.shouldLog(Log.DEBUG))
_log.debug("Reading bytes: type = " + type + " / uniqueId : " + _uniqueId + " / expiration : " + _expiration);
readMessage(buffer, 0, size, type);
@@ -159,7 +159,7 @@ public abstract class I2NPMessageImpl extends DataStructureImpl implements I2NPM
if (!eq)
throw new I2NPMessageException("Hash does not match for " + getClass().getName());
long start = _context.clock().now();
//long start = _context.clock().now();
if (_log.shouldLog(Log.DEBUG))
_log.debug("Reading bytes: type = " + type + " / uniqueId : " + _uniqueId + " / expiration : " + _expiration);
readMessage(data, cur, size, type);
@@ -215,7 +215,7 @@ public abstract class I2NPMessageImpl extends DataStructureImpl implements I2NPM
}
public int toByteArray(byte buffer[]) {
long start = _context.clock().now();
//long start = _context.clock().now();
int prefixLen = 1 // type
+ 4 // uniqueId

View File

@@ -160,7 +160,7 @@ public class TunnelDataMessage extends I2NPMessageImpl {
/** write the message body to the output array, starting at the given index */
protected int writeMessageBody(byte out[], int curIndex) throws I2NPMessageException {
if ( (_tunnelId <= 0) || (_data == null) )
throw new I2NPMessageException("Not enough data to write out (id=" + _tunnelId + " data=" + _data + ")");
throw new I2NPMessageException("Not enough data to write out (id=" + _tunnelId + ")");
if (_data.length <= 0)
throw new I2NPMessageException("Not enough data to write out (data.length=" + _data.length + ")");