forked from I2P_Developers/i2p.i2p
lint core, i2psnark, jetty, susimail
This commit is contained in:
@ -41,8 +41,8 @@ public class MetaNamingService extends DummyNamingService {
|
||||
while (tok.hasMoreTokens()) {
|
||||
try {
|
||||
Class<?> cls = Class.forName(tok.nextToken());
|
||||
Constructor<?> con = cls.getConstructor(new Class[] { I2PAppContext.class });
|
||||
addNamingService((NamingService)con.newInstance(new Object[] { context }), false);
|
||||
Constructor<?> con = cls.getConstructor(I2PAppContext.class);
|
||||
addNamingService((NamingService)con.newInstance(), false);
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
|
@ -537,7 +537,7 @@ public abstract class NamingService {
|
||||
try {
|
||||
Class<?> cls = Class.forName(impl);
|
||||
Constructor<?> con = cls.getConstructor(I2PAppContext.class);
|
||||
instance = (NamingService)con.newInstance(new Object[] { context });
|
||||
instance = (NamingService)con.newInstance(context);
|
||||
} catch (Exception ex) {
|
||||
Log log = context.logManager().getLog(NamingService.class);
|
||||
// Blockfile may throw RuntimeException but HostsTxt won't
|
||||
|
@ -92,8 +92,8 @@ public class CryptoConstants {
|
||||
if (ECConstants.isBCAvailable()) {
|
||||
try {
|
||||
Class<?> cls = Class.forName("org.bouncycastle.jce.spec.ElGamalParameterSpec");
|
||||
Constructor<?> con = cls.getConstructor(new Class[] {BigInteger.class, BigInteger.class});
|
||||
spec = (AlgorithmParameterSpec)con.newInstance(new Object[] {elgp, elgg});
|
||||
Constructor<?> con = cls.getConstructor(BigInteger.class, BigInteger.class);
|
||||
spec = (AlgorithmParameterSpec)con.newInstance(elgp, elgg);
|
||||
//System.out.println("BC ElG spec loaded");
|
||||
} catch (Exception e) {
|
||||
//System.out.println("BC ElG spec failed");
|
||||
|
@ -42,8 +42,8 @@ class ECConstants {
|
||||
if (Security.getProvider("BC") == null) {
|
||||
try {
|
||||
Class<?> cls = Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider");
|
||||
Constructor<?> con = cls.getConstructor(new Class[0]);
|
||||
Provider bc = (Provider)con.newInstance(new Object[0]);
|
||||
Constructor<?> con = cls.getConstructor();
|
||||
Provider bc = (Provider)con.newInstance();
|
||||
Security.addProvider(bc);
|
||||
log("Added BC provider");
|
||||
loaded = true;
|
||||
|
@ -16,7 +16,7 @@ import java.io.Serializable;
|
||||
* maps, and the like.
|
||||
*
|
||||
*/
|
||||
public class ByteArray implements Serializable, Comparable {
|
||||
public class ByteArray implements Serializable, Comparable<ByteArray> {
|
||||
private byte[] _data;
|
||||
private int _valid;
|
||||
private int _offset;
|
||||
@ -85,9 +85,8 @@ public class ByteArray implements Serializable, Comparable {
|
||||
return (llen == rlen) && DataHelper.eq(lhs, loff, rhs, roff, llen);
|
||||
}
|
||||
|
||||
public final int compareTo(Object obj) {
|
||||
if (obj.getClass() != getClass()) throw new ClassCastException("invalid object: " + obj);
|
||||
return DataHelper.compareTo(_data, ((ByteArray)obj).getData());
|
||||
public final int compareTo(ByteArray ba) {
|
||||
return DataHelper.compareTo(_data, ba.getData());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -300,9 +300,9 @@ public class FileUtil {
|
||||
if (!_failedOracle) {
|
||||
try {
|
||||
Class<?> p200 = Class.forName("java.util.jar.Pack200", true, ClassLoader.getSystemClassLoader());
|
||||
Method newUnpacker = p200.getMethod("newUnpacker", (Class[]) null);
|
||||
Method newUnpacker = p200.getMethod("newUnpacker");
|
||||
Object unpacker = newUnpacker.invoke(null,(Object[]) null);
|
||||
Method unpack = unpacker.getClass().getMethod("unpack", new Class[] {InputStream.class, JarOutputStream.class});
|
||||
Method unpack = unpacker.getClass().getMethod("unpack", InputStream.class, JarOutputStream.class);
|
||||
// throws IOException
|
||||
unpack.invoke(unpacker, new Object[] {in, out});
|
||||
return;
|
||||
@ -321,9 +321,9 @@ public class FileUtil {
|
||||
if (!_failedApache) {
|
||||
try {
|
||||
Class<?> p200 = Class.forName("org.apache.harmony.unpack200.Archive", true, ClassLoader.getSystemClassLoader());
|
||||
Constructor<?> newUnpacker = p200.getConstructor(new Class[] {InputStream.class, JarOutputStream.class});
|
||||
Object unpacker = newUnpacker.newInstance(new Object[] {in, out});
|
||||
Method unpack = unpacker.getClass().getMethod("unpack", (Class[]) null);
|
||||
Constructor<?> newUnpacker = p200.getConstructor(InputStream.class, JarOutputStream.class);
|
||||
Object unpacker = newUnpacker.newInstance(in, out);
|
||||
Method unpack = unpacker.getClass().getMethod("unpack");
|
||||
// throws IOException or Pack200Exception
|
||||
unpack.invoke(unpacker, (Object[]) null);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user