forked from I2P_Developers/i2p.i2p
findbugs
This commit is contained in:
@@ -292,11 +292,9 @@ class HTTPResponseOutputStream extends FilterOutputStream {
|
||||
} finally {
|
||||
if (_log.shouldLog(Log.INFO) && (_in != null))
|
||||
_log.info("After decompression, written=" + written +
|
||||
(_in != null ?
|
||||
" read=" + _in.getTotalRead()
|
||||
+ ", expanded=" + _in.getTotalExpanded() + ", remaining=" + _in.getRemaining()
|
||||
+ ", finished=" + _in.getFinished()
|
||||
: ""));
|
||||
+ ", finished=" + _in.getFinished());
|
||||
if (ba != null)
|
||||
_cache.release(ba);
|
||||
if (_out != null) try {
|
||||
|
@@ -212,10 +212,11 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
try { Thread.sleep(10*1000); } catch (InterruptedException ie) {}
|
||||
}
|
||||
}
|
||||
if (sockMgr == null) {
|
||||
l.log("Invalid I2CP configuration");
|
||||
throw new IllegalArgumentException("Socket manager could not be created");
|
||||
}
|
||||
// can't be null unless we limit the loop above
|
||||
//if (sockMgr == null) {
|
||||
// l.log("Invalid I2CP configuration");
|
||||
// throw new IllegalArgumentException("Socket manager could not be created");
|
||||
//}
|
||||
l.log("Tunnels ready for client: " + handlerName);
|
||||
|
||||
} // else delay creating session until createI2PSocket() is called
|
||||
@@ -556,7 +557,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
if (localPort == 0) {
|
||||
localPort = ss.getLocalPort();
|
||||
}
|
||||
notifyEvent("clientLocalPort", new Integer(ss.getLocalPort()));
|
||||
notifyEvent("clientLocalPort", Integer.valueOf(ss.getLocalPort()));
|
||||
// duplicates message in constructor
|
||||
//l.log("Listening for clients on port " + localPort + " of " + getTunnel().listenHost);
|
||||
|
||||
|
@@ -412,9 +412,9 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
||||
protected static String formatHeaders(Map<String, List<String>> headers, StringBuilder command) {
|
||||
StringBuilder buf = new StringBuilder(command.length() + headers.size() * 64);
|
||||
buf.append(command.toString().trim()).append("\r\n");
|
||||
for (Iterator<String> iter = headers.keySet().iterator(); iter.hasNext(); ) {
|
||||
String name = (String)iter.next();
|
||||
for(String val: headers.get(name)) {
|
||||
for (Map.Entry<String, List<String>> e : headers.entrySet()) {
|
||||
String name = e.getKey();
|
||||
for(String val: e.getValue()) {
|
||||
buf.append(name.trim()).append(": ").append(val.trim()).append("\r\n");
|
||||
}
|
||||
}
|
||||
|
@@ -311,7 +311,7 @@ class Connection {
|
||||
int windowSize;
|
||||
int remaining;
|
||||
synchronized (_outboundPackets) {
|
||||
_outboundPackets.put(new Long(packet.getSequenceNum()), packet);
|
||||
_outboundPackets.put(Long.valueOf(packet.getSequenceNum()), packet);
|
||||
windowSize = _options.getWindowSize();
|
||||
remaining = windowSize - _outboundPackets.size() ;
|
||||
_outboundPackets.notifyAll();
|
||||
@@ -441,7 +441,7 @@ class Connection {
|
||||
if (acked != null) {
|
||||
for (int i = 0; i < acked.size(); i++) {
|
||||
PacketLocal p = acked.get(i);
|
||||
_outboundPackets.remove(new Long(p.getSequenceNum()));
|
||||
_outboundPackets.remove(Long.valueOf(p.getSequenceNum()));
|
||||
_ackedPackets++;
|
||||
if (p.getNumSends() > 1) {
|
||||
_activeResends--;
|
||||
@@ -1129,7 +1129,7 @@ class Connection {
|
||||
synchronized (_outboundPackets) {
|
||||
if (_packet.getSequenceNum() == _highestAckedThrough + 1)
|
||||
isLowest = true;
|
||||
if (_outboundPackets.containsKey(new Long(_packet.getSequenceNum())))
|
||||
if (_outboundPackets.containsKey(Long.valueOf(_packet.getSequenceNum())))
|
||||
resend = true;
|
||||
}
|
||||
if ( (resend) && (_packet.getAckTime() <= 0) ) {
|
||||
|
@@ -229,8 +229,8 @@ class MessageInputStream extends InputStream {
|
||||
_highestReadyBlockId = messageId;
|
||||
long cur = _highestReadyBlockId + 1;
|
||||
// now pull in any previously pending blocks
|
||||
while (_notYetReadyBlocks.containsKey(new Long(cur))) {
|
||||
ByteArray ba = _notYetReadyBlocks.remove(new Long(cur));
|
||||
while (_notYetReadyBlocks.containsKey(Long.valueOf(cur))) {
|
||||
ByteArray ba = _notYetReadyBlocks.remove(Long.valueOf(cur));
|
||||
if ( (ba != null) && (ba.getData() != null) && (ba.getValid() > 0) ) {
|
||||
_readyDataBlocks.add(ba);
|
||||
}
|
||||
@@ -245,9 +245,9 @@ class MessageInputStream extends InputStream {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("message is out of order: " + messageId);
|
||||
if (_locallyClosed) // dont need the payload, just the msgId in order
|
||||
_notYetReadyBlocks.put(new Long(messageId), new ByteArray(null));
|
||||
_notYetReadyBlocks.put(Long.valueOf(messageId), new ByteArray(null));
|
||||
else
|
||||
_notYetReadyBlocks.put(new Long(messageId), payload);
|
||||
_notYetReadyBlocks.put(Long.valueOf(messageId), payload);
|
||||
_dataLock.notifyAll();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user