Changeset 71bc55b


Ignore:
Timestamp:
Oct 17, 2015 4:49:37 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
abc0f4c
Parents:
5f175455
Message:

lint core, i2psnark, jetty, susimail

Files:
16 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java

    r5f175455 r71bc55b  
    137137    public boolean configured() { return _configured; }
    138138   
     139    @SuppressWarnings({"unchecked", "rawtypes"})
    139140    public void setI2CPConfig(String i2cpHost, int i2cpPort, Map opts) {
    140141        if (i2cpHost != null)
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    r5f175455 r71bc55b  
    21922192    private void addMagnets() {
    21932193        boolean changed = false;
    2194         for (Iterator iter = _config.keySet().iterator(); iter.hasNext(); ) {
     2194        for (Iterator<?> iter = _config.keySet().iterator(); iter.hasNext(); ) {
    21952195            String k = (String) iter.next();
    21962196            if (k.startsWith(PROP_META_MAGNET_PREFIX)) {
  • apps/i2psnark/java/src/org/klomp/snark/dht/DHTTracker.java

    r5f175455 r71bc55b  
    107107     *  @return list or empty list (never null)
    108108     */
     109    @SuppressWarnings({"unchecked", "rawtypes"})
    109110    List<Hash> getPeers(InfoHash ih, int max, boolean noSeeds) {
    110111        Peers peers = _torrents.get(ih);
  • apps/i2psnark/java/src/org/klomp/snark/dht/KRPC.java

    r5f175455 r71bc55b  
    244244     *  @param parallel how many outstanding at once (unimplemented, always 1)
    245245     */
     246    @SuppressWarnings("unchecked")
    246247    private void explore(NID target, int maxNodes, long maxWait, int parallel) {
    247248        List<NodeInfo> nodes = _knownNodes.findClosest(target, maxNodes);
     
    328329     *  @return possibly empty (never null)
    329330     */
     331    @SuppressWarnings("unchecked")
    330332    public Collection<Hash> getPeersAndAnnounce(byte[] ih, int max, long maxWait,
    331333                                                int annMax, long annMaxWait,
     
    859861     *  @return null on error
    860862     */
     863    @SuppressWarnings("unchecked")
    861864    private ReplyWaiter sendQuery(NodeInfo nInfo, Map<String, Object> map, boolean repliable) {
    862865        if (nInfo.equals(_myNodeInfo))
     
    908911     *  @return success
    909912     */
     913    @SuppressWarnings("unchecked")
    910914    private boolean sendResponse(NodeInfo nInfo, MsgID msgID, Map<String, Object> map) {
    911915        if (nInfo.equals(_myNodeInfo))
  • apps/jetty/java/src/net/i2p/jetty/JettyStart.java

    r5f175455 r71bc55b  
    7373     *  Modified from XmlConfiguration.main()
    7474     */
     75    @SuppressWarnings({"unchecked", "rawtypes"})
    7576    public void parseArgs(String[] args) throws Exception {
    7677        Properties properties=new Properties();
  • apps/jetty/java/src/net/i2p/servlet/filters/XSSRequestWrapper.java

    r5f175455 r71bc55b  
    8585     */
    8686    @Override
     87    @SuppressWarnings({"unchecked", "rawtypes"})
    8788    public Map getParameterMap() {
    8889        Map rv = new HashMap();
  • apps/jetty/java/src/org/mortbay/servlet/MultiPartRequest.java

    r5f175455 r71bc55b  
    220220
    221221    /* ------------------------------------------------------------ */
     222    @SuppressWarnings("rawtypes")
    222223    public Hashtable[] getMultipleParams(String name)
    223224    {
  • apps/jetty/java/src/org/mortbay/util/ByteArrayPool.java

    r5f175455 r71bc55b  
    3030        Integer.getInteger("org.mortbay.util.ByteArrayPool.pool_size",8).intValue();
    3131   
    32     public static final ThreadLocal __pools=new BAThreadLocal();
     32    public static final ThreadLocal<byte[][]> __pools = new BAThreadLocal();
    3333    public static final AtomicInteger __slot = new AtomicInteger();
    3434   
     
    4040    public static byte[] getByteArray(int size)
    4141    {
    42         byte[][] pool = (byte[][])__pools.get();
     42        byte[][] pool = __pools.get();
    4343        boolean full=true;
    4444        for (int i=pool.length;i-->0;)
     
    6464    public static byte[] getByteArrayAtLeast(int minSize)
    6565    {
    66         byte[][] pool = (byte[][])__pools.get();
     66        byte[][] pool = __pools.get();
    6767        for (int i=pool.length;i-->0;)
    6868        {
     
    8585            return;
    8686       
    87         byte[][] pool = (byte[][])__pools.get();
     87        byte[][] pool = __pools.get();
    8888        for (int i=pool.length;i-->0;)
    8989        {
     
    104104    /* ------------------------------------------------------------ */
    105105    /* ------------------------------------------------------------ */
    106     private static final class BAThreadLocal extends ThreadLocal
     106    private static final class BAThreadLocal extends ThreadLocal<byte[][]>
    107107    {
    108         protected Object initialValue()
     108        @Override
     109        protected byte[][] initialValue()
    109110            {
    110111                return new byte[__POOL_SIZE][];
  • apps/susimail/src/src/i2p/susi/webmail/MailCache.java

    r5f175455 r71bc55b  
    110110         * @return An e-mail or null
    111111         */
     112        @SuppressWarnings({"unchecked", "rawtypes"})
    112113        public Mail getMail(String uidl, FetchMode mode) {
    113114               
     
    164165         * @since 0.9.13
    165166         */
     167        @SuppressWarnings({"unchecked", "rawtypes"})
    166168        public boolean getMail(FetchMode mode) {
    167169                if (mode == FetchMode.CACHE_ONLY)
  • apps/susimail/src/src/i2p/susi/webmail/WebMail.java

    r5f175455 r71bc55b  
    289289        private static class SenderSorter extends SorterBase {
    290290
    291                 private final Comparator collator = Collator.getInstance();
     291                private final Comparator<Object> collator = Collator.getInstance();
    292292
    293293                public SenderSorter( MailCache mailCache )
     
    308308         */
    309309        private static class SubjectSorter extends SorterBase {
    310                 private final Comparator collator = Collator.getInstance();
     310                private final Comparator<Object> collator = Collator.getInstance();
    311311
    312312                public SubjectSorter( MailCache mailCache )
     
    23002300         *  first prev next last
    23012301         */
    2302         private static void showPageButtons(PrintWriter out, Folder folder) {
     2302        private static void showPageButtons(PrintWriter out, Folder<?> folder) {
    23032303                out.println(
    23042304                        "<br>" +
  • core/java/src/net/i2p/client/naming/MetaNamingService.java

    r5f175455 r71bc55b  
    4242            try {
    4343                Class<?> cls = Class.forName(tok.nextToken());
    44                 Constructor<?> con = cls.getConstructor(new Class[] { I2PAppContext.class });
    45                 addNamingService((NamingService)con.newInstance(new Object[] { context }), false);
     44                Constructor<?> con = cls.getConstructor(I2PAppContext.class);
     45                addNamingService((NamingService)con.newInstance(), false);
    4646            } catch (Exception ex) {
    4747            }
  • core/java/src/net/i2p/client/naming/NamingService.java

    r5f175455 r71bc55b  
    538538            Class<?> cls = Class.forName(impl);
    539539            Constructor<?> con = cls.getConstructor(I2PAppContext.class);
    540             instance = (NamingService)con.newInstance(new Object[] { context });
     540            instance = (NamingService)con.newInstance(context);
    541541        } catch (Exception ex) {
    542542            Log log = context.logManager().getLog(NamingService.class);
  • core/java/src/net/i2p/crypto/CryptoConstants.java

    r5f175455 r71bc55b  
    9393            try {
    9494                Class<?> cls = Class.forName("org.bouncycastle.jce.spec.ElGamalParameterSpec");
    95                 Constructor<?> con = cls.getConstructor(new Class[] {BigInteger.class, BigInteger.class});
    96                 spec = (AlgorithmParameterSpec)con.newInstance(new Object[] {elgp, elgg});
     95                Constructor<?> con = cls.getConstructor(BigInteger.class, BigInteger.class);
     96                spec = (AlgorithmParameterSpec)con.newInstance(elgp, elgg);
    9797                //System.out.println("BC ElG spec loaded");
    9898            } catch (Exception e) {
  • core/java/src/net/i2p/crypto/ECConstants.java

    r5f175455 r71bc55b  
    4343            try {
    4444                Class<?> cls = Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider");
    45                 Constructor<?> con = cls.getConstructor(new Class[0]);
    46                 Provider bc = (Provider)con.newInstance(new Object[0]);
     45                Constructor<?> con = cls.getConstructor();
     46                Provider bc = (Provider)con.newInstance();
    4747                Security.addProvider(bc);
    4848                log("Added BC provider");
  • core/java/src/net/i2p/data/ByteArray.java

    r5f175455 r71bc55b  
    1717 *
    1818 */
    19 public class ByteArray implements Serializable, Comparable {
     19public class ByteArray implements Serializable, Comparable<ByteArray> {
    2020    private byte[] _data;
    2121    private int _valid;
     
    8686    }
    8787   
    88     public final int compareTo(Object obj) {
    89         if (obj.getClass() != getClass()) throw new ClassCastException("invalid object: " + obj);
    90         return DataHelper.compareTo(_data, ((ByteArray)obj).getData());
     88    public final int compareTo(ByteArray ba) {
     89        return DataHelper.compareTo(_data, ba.getData());
    9190    }
    9291   
  • core/java/src/net/i2p/util/FileUtil.java

    r5f175455 r71bc55b  
    301301            try {
    302302                Class<?> p200 = Class.forName("java.util.jar.Pack200", true, ClassLoader.getSystemClassLoader());
    303                 Method newUnpacker = p200.getMethod("newUnpacker", (Class[]) null);
     303                Method newUnpacker = p200.getMethod("newUnpacker");
    304304                Object unpacker = newUnpacker.invoke(null,(Object[])  null);
    305                 Method unpack = unpacker.getClass().getMethod("unpack", new Class[] {InputStream.class, JarOutputStream.class});
     305                Method unpack = unpacker.getClass().getMethod("unpack", InputStream.class, JarOutputStream.class);
    306306                // throws IOException
    307307                unpack.invoke(unpacker, new Object[] {in, out});
     
    322322            try {
    323323                Class<?> p200 = Class.forName("org.apache.harmony.unpack200.Archive", true, ClassLoader.getSystemClassLoader());
    324                 Constructor<?> newUnpacker = p200.getConstructor(new Class[] {InputStream.class, JarOutputStream.class});
    325                 Object unpacker = newUnpacker.newInstance(new Object[] {in, out});
    326                 Method unpack = unpacker.getClass().getMethod("unpack", (Class[]) null);
     324                Constructor<?> newUnpacker = p200.getConstructor(InputStream.class, JarOutputStream.class);
     325                Object unpacker = newUnpacker.newInstance(in, out);
     326                Method unpack = unpacker.getClass().getMethod("unpack");
    327327                // throws IOException or Pack200Exception
    328328                unpack.invoke(unpacker, (Object[]) null);
Note: See TracChangeset for help on using the changeset viewer.