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/functional/org/openstreetmap/josm/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java

    r6995 r7005  
    5555        int numRelations = 1000;
    5656
    57         ArrayList<Node> nodes = new ArrayList<Node>();
    58         ArrayList<Way> ways = new ArrayList<Way>();
     57        ArrayList<Node> nodes = new ArrayList<>();
     58        ArrayList<Way> ways = new ArrayList<>();
    5959
    6060        // create a set of nodes
     
    122122    static public void createDataSetOnServer(DataSet ds) throws OsmTransferException {
    123123        logger.info("creating data set on the server ...");
    124         ArrayList<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>();
     124        ArrayList<OsmPrimitive> primitives = new ArrayList<>();
    125125        primitives.addAll(testDataSet.getNodes());
    126126        primitives.addAll(testDataSet.getWays());
     
    246246    public void testMultiGet10Nodes() throws OsmTransferException {
    247247        MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader();
    248         ArrayList<Node> nodes = new ArrayList<Node>(ds.getNodes());
     248        ArrayList<Node> nodes = new ArrayList<>(ds.getNodes());
    249249        for (int i =0; i< 10; i++) {
    250250            reader.append(nodes.get(i));
     
    263263    public void testMultiGet10Ways() throws OsmTransferException {
    264264        MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader();
    265         ArrayList<Way> ways= new ArrayList<Way>(ds.getWays());
     265        ArrayList<Way> ways= new ArrayList<>(ds.getWays());
    266266        for (int i =0; i< 10; i++) {
    267267            reader.append(ways.get(i));
     
    281281    public void testMultiGet10Relations() throws OsmTransferException {
    282282        MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader();
    283         ArrayList<Relation> relations= new ArrayList<Relation>(ds.getRelations());
     283        ArrayList<Relation> relations= new ArrayList<>(ds.getRelations());
    284284        for (int i =0; i< 10; i++) {
    285285            reader.append(relations.get(i));
     
    299299    public void testMultiGet800Nodes() throws OsmTransferException {
    300300        MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader();
    301         ArrayList<Node> nodes = new ArrayList<Node>(ds.getNodes());
     301        ArrayList<Node> nodes = new ArrayList<>(ds.getNodes());
    302302        for (int i =0; i< 812; i++) {
    303303            reader.append(nodes.get(i));
     
    316316    public void multiGetWithNonExistingNode() throws OsmTransferException {
    317317        MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader();
    318         ArrayList<Node> nodes = new ArrayList<Node>(ds.getNodes());
     318        ArrayList<Node> nodes = new ArrayList<>(ds.getNodes());
    319319        for (int i =0; i< 10; i++) {
    320320            reader.append(nodes.get(i));
  • trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java

    r6995 r7005  
    127127    static public void createDataSetOnServer(DataSet ds) throws OsmTransferException {
    128128        logger.info("creating data set on the server ...");
    129         ArrayList<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>();
     129        ArrayList<OsmPrimitive> primitives = new ArrayList<>();
    130130        primitives.addAll(ds.getNodes());
    131131        primitives.addAll(ds.getWays());
     
    328328        }
    329329        assertEquals(2, referers.getRelations().size());  // two relations referring to
    330         Set<Long> expectedNodeIds = new HashSet<Long>();
     330        Set<Long> expectedNodeIds = new HashSet<>();
    331331        for (Way way : referers.getWays()) {
    332332            Way orig = (Way) ds.getPrimitiveById(way);
     
    359359        DataSet referers = reader.parseOsm(NullProgressMonitor.INSTANCE);
    360360
    361         Set<Long> referringRelationsIds = new HashSet<Long>();
     361        Set<Long> referringRelationsIds = new HashSet<>();
    362362        r = lookupRelation(referers, 6);
    363363        assertNotNull(r);
     
    386386        // ways are incomplete after reading.
    387387        //
    388         Set<Long> expectedWayIds = new HashSet<Long>();
     388        Set<Long> expectedWayIds = new HashSet<>();
    389389        for (RelationMember m : lookupRelation(ds, 6).getMembers()) {
    390390            if (m.isWay()) {
     
    420420
    421421    protected Set<Long> getNodeIdsInWay(Way way) {
    422         HashSet<Long> ret = new HashSet<Long>();
     422        HashSet<Long> ret = new HashSet<>();
    423423        if (way == null)return ret;
    424424        for (Node n: way.getNodes()) {
     
    429429
    430430    protected Set<Long> getNodeIdsInRelation(Relation r) {
    431         HashSet<Long> ret = new HashSet<Long>();
     431        HashSet<Long> ret = new HashSet<>();
    432432        if (r == null) return ret;
    433433        for (RelationMember m: r.getMembers()) {
     
    455455        DataSet referers = reader.parseOsm(NullProgressMonitor.INSTANCE);
    456456
    457         Set<Long> referringRelationsIds = new HashSet<Long>();
     457        Set<Long> referringRelationsIds = new HashSet<>();
    458458        r = lookupRelation(referers, 6);
    459459        assertNotNull(r);
     
    482482        // ways are completely read after reading the relations
    483483        //
    484         Set<Long> expectedWayIds = new HashSet<Long>();
     484        Set<Long> expectedWayIds = new HashSet<>();
    485485        for (RelationMember m : lookupRelation(ds, 6).getMembers()) {
    486486            if (m.isWay()) {
     
    509509        }
    510510
    511         Set<Long> expectedNodeIds = new HashSet<Long>();
     511        Set<Long> expectedNodeIds = new HashSet<>();
    512512        for (int i = 6; i < 10; i++) {
    513513            Relation r1 = lookupRelation(ds, i);
Note: See TracChangeset for help on using the changeset viewer.