Changeset 24ae66d


Ignore:
Timestamp:
Nov 20, 2013 11:06:17 PM (6 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
4910266d, 53623da2
Parents:
228bd98
Message:

Core JUnit tests: type arguments, unused imports

Location:
core/java/test/junit/net/i2p
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • core/java/test/junit/net/i2p/client/I2PSessionTest.java

    r228bd98 r24ae66d  
    2525 */
    2626public class I2PSessionTest extends TestCase implements I2PSessionListener{
    27     private Set _s;
     27    private Set<String> _s;
    2828   
    2929   
     
    5757        session.setSessionListener(this);
    5858       
    59         _s = new HashSet();
     59        _s = new HashSet<String>();
    6060        _s.add("a");
    6161        _s.add("b");
  • core/java/test/junit/net/i2p/client/naming/BlockfileNamingServiceTest.java

    r228bd98 r24ae66d  
    66import java.io.File;
    77import java.io.FileOutputStream;
    8 import java.io.IOException;
    98import java.io.InputStream;
    109import java.io.OutputStream;
  • core/java/test/junit/net/i2p/crypto/ElGamalTest.java

    r228bd98 r24ae66d  
    157157       
    158158        byte encrypted[] = _context.elGamalAESEngine().encryptAESBlock(msg.getBytes(), sessionKey, iv, null, null, 64);
    159         Set foundTags = new HashSet();
     159        Set<SessionTag> foundTags = new HashSet<SessionTag>();
    160160        SessionKey foundKey = new SessionKey();
    161161        byte decrypted[] = null;
     
    339339        SessionKey sessionKey = ctx.keyGenerator().generateSessionKey();
    340340        for (int i = 0; i < 10; i++) {
    341             Set tags = new HashSet(5);
     341            Set<SessionTag> tags = new HashSet<SessionTag>(5);
    342342            if (i == 0) {
    343343                for (int j = 0; j < 5; j++)
  • core/java/test/junit/net/i2p/crypto/SHA256Test.java

    r228bd98 r24ae66d  
    1111import junit.framework.TestCase;
    1212import net.i2p.I2PAppContext;
    13 import net.i2p.data.DataHelper;
    1413import net.i2p.data.Hash;
    1514/**
  • core/java/test/junit/net/i2p/crypto/SessionEncryptionTest.java

    r228bd98 r24ae66d  
    8282        SessionTag tag4 = new SessionTag(true);
    8383       
    84         HashSet firstTags = new HashSet();
     84        HashSet<SessionTag> firstTags = new HashSet<SessionTag>();
    8585        firstTags.add(tag1);
    8686        firstTags.add(tag2);
    8787       
    88         HashSet secondTags = new HashSet();
     88        HashSet<SessionTag> secondTags = new HashSet<SessionTag>();
    8989        secondTags.add(tag3);
    9090        secondTags.add(tag4);
     
    181181        SessionTag tag4 = new SessionTag(true);
    182182       
    183         HashSet firstTags = new HashSet();
     183        HashSet<SessionTag> firstTags = new HashSet<SessionTag>();
    184184        firstTags.add(tag1);
    185185        firstTags.add(tag2);
    186186       
    187         HashSet secondTags = new HashSet();
     187        HashSet<SessionTag> secondTags = new HashSet<SessionTag>();
    188188        secondTags.add(tag3);
    189189        secondTags.add(tag4);
     
    272272       
    273273        for (int i = 0; i < 1000; i++) {
    274             Set tags = null;
     274            Set<SessionTag> tags = null;
    275275            SessionKey nextKey = null;
    276276            curKey = _context.sessionKeyManager().getCurrentKey(pubKey);
     
    303303    }
    304304   
    305     private Set generateNewTags(int numTags) {
    306         Set tags = new HashSet(numTags);
     305    private Set<SessionTag> generateNewTags(int numTags) {
     306        Set<SessionTag> tags = new HashSet<SessionTag>(numTags);
    307307        for (int i = 0; i < numTags; i++)
    308308            tags.add(new SessionTag(true));
  • core/java/test/junit/net/i2p/data/PayloadTest.java

    r228bd98 r24ae66d  
    88 *
    99 */
    10 
    11 import java.io.ByteArrayInputStream;
    12 import java.io.ByteArrayOutputStream;
    1310
    1411/**
  • core/java/test/junit/net/i2p/data/RouterAddressTest.java

    r228bd98 r24ae66d  
    1010 
    1111import java.io.ByteArrayOutputStream;
    12 import java.util.Date;
    1312import java.util.Properties;
    1413
  • core/java/test/junit/net/i2p/data/RouterInfoTest.java

    r228bd98 r24ae66d  
    2424    public DataStructure createDataStructure() throws DataFormatException {
    2525        RouterInfo info = new RouterInfo();
    26         HashSet addresses = new HashSet();
     26        HashSet<RouterAddress> addresses = new HashSet<RouterAddress>();
    2727        DataStructure structure = (new RouterAddressTest()).createDataStructure();
    28         addresses.add(structure);
     28        addresses.add((RouterAddress) structure);
    2929        info.setAddresses(addresses);
    3030       
     
    5858        info.setOptions(options);
    5959       
    60         HashSet peers = new HashSet();
     60        HashSet<Hash> peers = new HashSet<Hash>();
    6161        structure = (new HashTest()).createDataStructure();
    62         peers.add(structure);
     62        peers.add((Hash) structure);
    6363        info.setPeers(peers);
    6464        info.setPublished(System.currentTimeMillis());
  • core/java/test/junit/net/i2p/data/SimpleDataStructureTest.java

    r228bd98 r24ae66d  
    88 *
    99 */
    10 
    11 import java.io.ByteArrayInputStream;
    12 import java.io.ByteArrayOutputStream;
    1310
    1411import junit.framework.TestCase;
  • core/java/test/junit/net/i2p/data/i2cp/MessagePayloadMessageTest.java

    r228bd98 r24ae66d  
    88 *
    99 */
    10 
    11 import java.io.ByteArrayInputStream;
    12 import java.io.ByteArrayOutputStream;
    1310
    1411import net.i2p.data.StructureTest;
  • core/java/test/junit/net/i2p/data/i2cp/SendMessageExpiresMessageTest.java

    r228bd98 r24ae66d  
    88 *
    99 */
    10 
    11 import java.io.ByteArrayInputStream;
    12 import java.io.ByteArrayOutputStream;
    1310
    1411import net.i2p.data.StructureTest;
  • core/java/test/junit/net/i2p/data/i2cp/SendMessageMessageTest.java

    r228bd98 r24ae66d  
    88 *
    99 */
    10 
    11 import java.io.ByteArrayInputStream;
    12 import java.io.ByteArrayOutputStream;
    1310
    1411import net.i2p.data.StructureTest;
  • core/java/test/junit/net/i2p/stat/SimpleStatDumper.java

    r228bd98 r24ae66d  
    2222
    2323    private static void dumpFrequencies(I2PAppContext ctx, StringBuilder buf) {
    24         Set frequencies = new TreeSet(ctx.statManager().getFrequencyNames());
    25         for (Iterator iter = frequencies.iterator(); iter.hasNext();) {
    26             String name = (String) iter.next();
     24        Set<String> frequencies = new TreeSet<String>(ctx.statManager().getFrequencyNames());
     25        for (Iterator<String> iter = frequencies.iterator(); iter.hasNext();) {
     26            String name = iter.next();
    2727            FrequencyStat freq = ctx.statManager().getFrequency(name);
    2828            buf.append('\n');
     
    4242
    4343    private static void dumpRates(I2PAppContext ctx, StringBuilder buf) {
    44         Set rates = new TreeSet(ctx.statManager().getRateNames());
    45         for (Iterator iter = rates.iterator(); iter.hasNext();) {
    46             String name = (String) iter.next();
     44        Set<String> rates = new TreeSet<String>(ctx.statManager().getRateNames());
     45        for (Iterator<String> iter = rates.iterator(); iter.hasNext();) {
     46            String name = iter.next();
    4747            RateStat rate = ctx.statManager().getRate(name);
    4848            buf.append('\n');
  • core/java/test/junit/net/i2p/stat/StatLogSplitter.java

    r228bd98 r24ae66d  
    3030   
    3131    private static void splitLog(String filename) {
    32         Map outputFiles = new HashMap(4);
     32        Map<String, FileWriter> outputFiles = new HashMap<String, FileWriter>(4);
    3333        try {
    3434            BufferedReader in = new BufferedReader(new FileReader(filename));
     
    6969            ioe.printStackTrace();
    7070        }
    71         for (Iterator iter = outputFiles.values().iterator(); iter.hasNext(); ) {
    72             FileWriter out = (FileWriter)iter.next();
     71        for (Iterator<FileWriter> iter = outputFiles.values().iterator(); iter.hasNext(); ) {
     72            FileWriter out = iter.next();
    7373            try { out.close(); } catch (IOException ioe) {}
    7474        }
Note: See TracChangeset for help on using the changeset viewer.