findbugs all over

This commit is contained in:
zzz
2014-10-07 14:59:49 +00:00
parent 8270a92a44
commit 28ad95f892
5 changed files with 9 additions and 6 deletions

View File

@ -185,7 +185,6 @@ class Sorters {
private static int getStatus(Snark snark) {
long remaining = snark.getRemainingLength();
long needed = snark.getNeededLength();
if (snark.isStopped()) {
if (remaining < 0)
return 0;

View File

@ -15,6 +15,7 @@
package org.mortbay.util;
import java.util.concurrent.atomic.AtomicInteger;
/* ------------------------------------------------------------ */
/** Byte Array Pool
@ -29,7 +30,7 @@ public class ByteArrayPool
Integer.getInteger("org.mortbay.util.ByteArrayPool.pool_size",8).intValue();
public static final ThreadLocal __pools=new BAThreadLocal();
public static int __slot;
public static final AtomicInteger __slot = new AtomicInteger();
/* ------------------------------------------------------------ */
/** Get a byte array from the pool of known size.
@ -94,7 +95,7 @@ public class ByteArrayPool
}
// slot.
int s = __slot++;
int s = __slot.getAndIncrement();
if (s<0)s=-s;
pool[s%pool.length]=b;
}

View File

@ -16,7 +16,7 @@ import net.i2p.I2PAppContext;
* @since 0.9.14
*/
public class DomainSocketFactory {
public static String I2CP_SOCKET_ADDRESS = "net.i2p.client.i2cp";
public static final String I2CP_SOCKET_ADDRESS = "net.i2p.client.i2cp";
/**
* @throws UnsupportedOperationException always

View File

@ -846,7 +846,11 @@ public class Ed25519FieldElement extends FieldElement {
@Override
public int hashCode() {
return t.hashCode(); // TODO should this be something else?
int rv = 0;
for (int i = 0; i < 10; i++) {
rv ^= t[i];
}
return rv;
}
@Override

View File

@ -569,7 +569,6 @@ class UDPPacketReader {
* @since 0.9.16
*/
public int highestReceived() {
int count = fragmentCount();
for (int i = _bitfieldSize - 1; i >= 0; i--) {
byte b = _message[_bitfieldStart + i];
if ((b & 0x7f) == 0)