Changeset 7005 in josm for trunk/test/unit/org/openstreetmap


Ignore:
Timestamp:
2014-04-26T17:39:23+02:00 (11 years ago)
Author:
Don-vip
Message:

see #8465 - use diamond operator where applicable

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java

    r6881 r7005  
    4444        ds.addPrimitive(n2);
    4545
    46         Collection<OsmPrimitive> all = new HashSet<OsmPrimitive>();
     46        Collection<OsmPrimitive> all = new HashSet<>();
    4747        all.addAll(Arrays.asList(new OsmPrimitive[] {n1, n2}));
    4848
    49         List<Filter> filters = new LinkedList<Filter>();
     49        List<Filter> filters = new LinkedList<>();
    5050        Filter f1 = new Filter();
    5151        f1.text = "fixme";
     
    6767            DataSet ds = OsmReader.parseDataSet(new FileInputStream("data_nodist/filterTests.osm"), NullProgressMonitor.INSTANCE);
    6868
    69             List<Filter> filters = new LinkedList<Filter>();
     69            List<Filter> filters = new LinkedList<>();
    7070            switch (i) {
    7171            case 1: {
  • trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java

    r6881 r7005  
    2020
    2121    private void compareReferrers(OsmPrimitive actual, OsmPrimitive... expected) {
    22         Assert.assertEquals(new HashSet<OsmPrimitive>(Arrays.asList(expected)),
    23                 new HashSet<OsmPrimitive>(actual.getReferrers()));
     22        Assert.assertEquals(new HashSet<>(Arrays.asList(expected)),
     23                new HashSet<>(actual.getReferrers()));
    2424    }
    2525
  • trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java

    r6881 r7005  
    2727
    2828    private void removeAllTest(DataSet ds) {
    29         List<Node> allNodes = new ArrayList<Node>(ds.getNodes());
    30         List<Way> allWays = new ArrayList<Way>(ds.getWays());
    31         List<Relation> allRelations = new ArrayList<Relation>(ds.getRelations());
     29        List<Node> allNodes = new ArrayList<>(ds.getNodes());
     30        List<Way> allWays = new ArrayList<>(ds.getWays());
     31        List<Relation> allRelations = new ArrayList<>(ds.getRelations());
    3232
    3333        QuadBuckets<Node> nodes = Reflection.field("nodes").ofType(new TypeRef<QuadBuckets<Node>>() {}).in(ds).get();
  • trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java

    r4603 r7005  
    9393        way.addNode(1);
    9494        way.addNode(2);
    95         ArrayList<Long> ids = new ArrayList<Long>();
     95        ArrayList<Long> ids = new ArrayList<>();
    9696        for (long id : way.getNodes()) {
    9797            ids.add(id);
     
    102102        assertEquals(2, (long) ids.get(1));
    103103    }
    104 
    105104}
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java

    r6995 r7005  
    3333     */
    3434    public static void main(String[] args) {
    35         Map<String, Projection> allCodes = new HashMap<String, Projection>();
     35        Map<String, Projection> allCodes = new HashMap<>();
    3636        for (ProjectionChoice pc : ProjectionPreference.getProjectionChoices()) {
    3737            for (String code : pc.allCodes()) {
  • trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java

    r6995 r7005  
    5858        setUp();
    5959
    60         Map<String, Projection> supportedCodesMap = new HashMap<String, Projection>();
     60        Map<String, Projection> supportedCodesMap = new HashMap<>();
    6161        for (ProjectionChoice pc : ProjectionPreference.getProjectionChoices()) {
    6262            for (String code : pc.allCodes()) {
     
    6868        }
    6969
    70         List<TestData> prevData = new ArrayList<TestData>();
     70        List<TestData> prevData = new ArrayList<>();
    7171        if (new File(PROJECTION_DATA_FILE).exists()) {
    7272            prevData = readData();
    7373        }
    74         Map<String,TestData> prevCodesMap = new HashMap<String,TestData>();
     74        Map<String,TestData> prevCodesMap = new HashMap<>();
    7575        for (TestData data : prevData) {
    7676            prevCodesMap.put(data.code, data);
    7777        }
    7878
    79         Set<String> codesToWrite = new LinkedHashSet<String>();
     79        Set<String> codesToWrite = new LinkedHashSet<>();
    8080        for (TestData data : prevData) {
    8181            if (supportedCodesMap.containsKey(data.code)) {
     
    116116    private static List<TestData> readData() throws IOException, FileNotFoundException {
    117117        BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(PROJECTION_DATA_FILE), Utils.UTF_8));
    118         List<TestData> result = new ArrayList<TestData>();
     118        List<TestData> result = new ArrayList<>();
    119119        String line;
    120120        while ((line = in.readLine()) != null) {
     
    159159    public void regressionTest() throws IOException, FileNotFoundException {
    160160        List<TestData> allData = readData();
    161         Set<String> dataCodes = new HashSet<String>();
     161        Set<String> dataCodes = new HashSet<>();
    162162        for (TestData data : allData) {
    163163            dataCodes.add(data.code);
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java

    r6949 r7005  
    7373        c.initialize();
    7474
    75         LinkedHashSet<String> assertionErrors = new LinkedHashSet<String>();
     75        LinkedHashSet<String> assertionErrors = new LinkedHashSet<>();
    7676        for (final MapCSSTagChecker.TagCheck check : c.checks) {
    7777            System.out.println("Check: "+check);
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java

    r6920 r7005  
    144144    public void testPresetValues() throws Exception {
    145145        final Collection<TaggingPreset> presets = TaggingPresetReader.readFromPreferences(false, false);
    146         final Set<Tag> values = new LinkedHashSet<Tag>();
     146        final Set<Tag> values = new LinkedHashSet<>();
    147147        for (final TaggingPreset p : presets) {
    148148            for (final TaggingPresetItem i : p.data) {
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/nodes/NodeListMergeModelTest.java

    r6471 r7005  
    1919import org.junit.Test;
    2020import org.openstreetmap.josm.Main;
    21 import org.openstreetmap.josm.data.Preferences;
    2221import org.openstreetmap.josm.data.osm.DatasetFactory;
    2322import org.openstreetmap.josm.data.osm.Node;
     
    705704
    706705        class MyListener implements PropertyChangeListener {
    707             public ArrayList<PropertyChangeEvent> events = new ArrayList<PropertyChangeEvent>();
     706            public ArrayList<PropertyChangeEvent> events = new ArrayList<>();
    708707
    709708            public void propertyChange(PropertyChangeEvent evt) {
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/properties/PropertiesMergeModelTest.java

    r6881 r7005  
    5959
    6060    private void populate(OsmPrimitive my, OsmPrimitive their) {
    61         model.populate(new Conflict<OsmPrimitive>(my, their));
     61        model.populate(new Conflict<>(my, their));
    6262    }
    6363
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeItemTest.java

    r6471 r7005  
    99import org.junit.Test;
    1010import org.openstreetmap.josm.Main;
    11 import org.openstreetmap.josm.data.Preferences;
    1211import org.openstreetmap.josm.data.osm.Node;
    1312import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType;
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeModelTest.java

    r6471 r7005  
    1313import org.junit.Test;
    1414import org.openstreetmap.josm.Main;
    15 import org.openstreetmap.josm.data.Preferences;
    1615import org.openstreetmap.josm.data.osm.Node;
    1716import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType;
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java

    r6471 r7005  
    1010import org.junit.Test;
    1111import org.openstreetmap.josm.Main;
    12 import org.openstreetmap.josm.data.Preferences;
    1312import org.openstreetmap.josm.data.osm.DataSet;
    1413import org.openstreetmap.josm.data.osm.Relation;
  • trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java

    r6471 r7005  
    1111import org.junit.Test;
    1212import org.openstreetmap.josm.Main;
    13 import org.openstreetmap.josm.data.Preferences;
    1413import org.openstreetmap.josm.data.osm.DataSet;
    1514import org.openstreetmap.josm.data.osm.Relation;
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/ToolbarPreferencesTest.java

    r3175 r7005  
    3131
    3232        public List<ActionParameter<?>> getActionParameters() {
    33             List<ActionParameter<?>> result = new ArrayList<ActionParameter<?>>();
     33            List<ActionParameter<?>> result = new ArrayList<>();
    3434            result.add(new StringActionParameter("param1"));
    3535            result.add(new StringActionParameter("param2"));
     
    4444
    4545    private void checkAction(ActionDefinition a, Object... params) {
    46         Map<String, Object> expected = new HashMap<String, Object>();
     46        Map<String, Object> expected = new HashMap<>();
    4747        for (int i=0; i<params.length; i+=2) {
    4848            expected.put((String)params[i], params[i+1]);
     
    5353    @Test
    5454    public void test1() {
    55         Map<String, Action> actions = new HashMap<String, Action>();
     55        Map<String, Action> actions = new HashMap<>();
    5656        actions.put("action", new TestAction());
    5757        ActionParser parser = new ActionParser(actions);
Note: See TracChangeset for help on using the changeset viewer.