Changeset 11121 in josm


Ignore:
Timestamp:
2016-10-12T01:40:24+02:00 (8 years ago)
Author:
Don-vip
Message:

checkstyle

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/Changeset.java

    r11115 r11121  
    209209        CheckParameterUtil.ensureParameterNotNull(keys, "keys");
    210210        keys.values().stream()
    211                 .filter(value -> (value != null && value.length() > MAX_CHANGESET_TAG_LENGTH))
     211                .filter(value -> value != null && value.length() > MAX_CHANGESET_TAG_LENGTH)
    212212                .findFirst()
    213213                .ifPresent(value -> {
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java

    r11115 r11121  
    226226        synchronized (listeners) {
    227227            PropertyChangeEvent evt = new PropertyChangeEvent(this, FROZEN_PROP, oldValue, newValue);
    228             listeners.forEach((listener) -> {
    229                 listener.propertyChange(evt);
    230             });
     228            listeners.forEach(listener -> listener.propertyChange(evt));
    231229            }
    232230        }
  • trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java

    r11115 r11121  
    77import static org.junit.Assert.assertTrue;
    88
    9 import java.util.ArrayList;
    109import java.util.Collections;
    1110import java.util.List;
  • trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDataSetTest.java

    r11115 r11121  
    22package org.openstreetmap.josm.data.osm;
    33
     4import java.util.Date;
     5import java.util.Set;
     6
     7import org.junit.Assert;
    48import org.junit.Rule;
    59import org.junit.Test;
    6 import org.junit.Assert;
     10import org.openstreetmap.josm.Main;
     11import org.openstreetmap.josm.data.coor.LatLon;
     12import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType;
     13import org.openstreetmap.josm.data.osm.history.HistoryNode;
     14import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive;
    715import org.openstreetmap.josm.testutils.JOSMTestRules;
    8 import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType;
    916
    1017import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    11 import java.util.Date;
    12 import java.util.Set;
    13 import org.openstreetmap.josm.data.coor.LatLon;
    14 import org.openstreetmap.josm.data.osm.history.HistoryNode;
    15 import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive;
    1618
    1719/**
     
    3840            Assert.fail("Should have thrown an IllegalArgumentException as we gave a null argument.");
    3941        } catch (IllegalArgumentException e) {
     42            Main.trace(e);
    4043            // Was expected
    4144        }
    42        
     45
    4346        // empty object, a modification type => empty list
    4447        Assert.assertTrue(
     
    4750                    ChangesetModificationType.CREATED).isEmpty()
    4851        );
    49        
     52
    5053        // object with various items and modification types, fetch for CREATED
    5154        // => list containing only the CREATED item
     
    6063        Assert.assertEquals("We should have found only one item.", 1, result.size());
    6164        Assert.assertTrue("The item found is prim1.", result.contains(prim1));
    62        
    6365    }
    6466}
  • trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java

    r11115 r11121  
    22package org.openstreetmap.josm.data.osm;
    33
     4import static org.openstreetmap.josm.data.osm.Changeset.MAX_CHANGESET_TAG_LENGTH;
     5
     6import java.util.HashMap;
     7import java.util.Map;
     8
     9import org.junit.Assert;
    410import org.junit.Rule;
    511import org.junit.Test;
     12import org.openstreetmap.josm.Main;
    613import org.openstreetmap.josm.testutils.JOSMTestRules;
    714
    815import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    9 import java.util.HashMap;
    10 import java.util.Map;
    11 import org.junit.Assert;
    12 import static org.openstreetmap.josm.data.osm.Changeset.MAX_CHANGESET_TAG_LENGTH;
    1316
    1417/**
     
    3538            Assert.fail("Should have thrown an IllegalArgumentException as we gave a null argument.");
    3639        } catch (IllegalArgumentException e) {
     40            Main.trace(e);
    3741            // Was expected
    3842        }
    39        
     43
    4044        // Add a map with no values
    4145        // => the key list is empty
    4246        Map<String, String> keys = new HashMap<>();
    43        
     47
    4448        // Add a map with valid values : null and short texts
    4549        // => all the items are in the keys
     
    4852        cs.setKeys(keys);
    4953        Assert.assertEquals("Both valid keys should have been put in the ChangeSet.", 2, cs.getKeys().size());
    50        
     54
    5155        // Add a map with too long values => IllegalArgumentException
    5256        keys = new HashMap<>();
    5357        StringBuilder b = new StringBuilder(MAX_CHANGESET_TAG_LENGTH + 1);
    54         for (int i = 0; i < MAX_CHANGESET_TAG_LENGTH + 1; i++){
     58        for (int i = 0; i < MAX_CHANGESET_TAG_LENGTH + 1; i++) {
    5559           b.append("x");
    5660        }
     
    6064            Assert.fail("Should have thrown an IllegalArgumentException as we gave a too long value.");
    6165        } catch (IllegalArgumentException e) {
     66            Main.trace(e);
    6267            // Was expected
    6368        }
    64                
    6569    }
    6670}
Note: See TracChangeset for help on using the changeset viewer.