Changeset 11121 in josm
- Timestamp:
- 2016-10-12T01:40:24+02:00 (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
r11115 r11121 209 209 CheckParameterUtil.ensureParameterNotNull(keys, "keys"); 210 210 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) 212 212 .findFirst() 213 213 .ifPresent(value -> { -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
r11115 r11121 226 226 synchronized (listeners) { 227 227 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)); 231 229 } 232 230 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java
r11115 r11121 7 7 import static org.junit.Assert.assertTrue; 8 8 9 import java.util.ArrayList;10 9 import java.util.Collections; 11 10 import java.util.List; -
trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetDataSetTest.java
r11115 r11121 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import java.util.Date; 5 import java.util.Set; 6 7 import org.junit.Assert; 4 8 import org.junit.Rule; 5 9 import org.junit.Test; 6 import org.junit.Assert; 10 import org.openstreetmap.josm.Main; 11 import org.openstreetmap.josm.data.coor.LatLon; 12 import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType; 13 import org.openstreetmap.josm.data.osm.history.HistoryNode; 14 import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive; 7 15 import org.openstreetmap.josm.testutils.JOSMTestRules; 8 import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType;9 16 10 17 import 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;16 18 17 19 /** … … 38 40 Assert.fail("Should have thrown an IllegalArgumentException as we gave a null argument."); 39 41 } catch (IllegalArgumentException e) { 42 Main.trace(e); 40 43 // Was expected 41 44 } 42 45 43 46 // empty object, a modification type => empty list 44 47 Assert.assertTrue( … … 47 50 ChangesetModificationType.CREATED).isEmpty() 48 51 ); 49 52 50 53 // object with various items and modification types, fetch for CREATED 51 54 // => list containing only the CREATED item … … 60 63 Assert.assertEquals("We should have found only one item.", 1, result.size()); 61 64 Assert.assertTrue("The item found is prim1.", result.contains(prim1)); 62 63 65 } 64 66 } -
trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java
r11115 r11121 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import static org.openstreetmap.josm.data.osm.Changeset.MAX_CHANGESET_TAG_LENGTH; 5 6 import java.util.HashMap; 7 import java.util.Map; 8 9 import org.junit.Assert; 4 10 import org.junit.Rule; 5 11 import org.junit.Test; 12 import org.openstreetmap.josm.Main; 6 13 import org.openstreetmap.josm.testutils.JOSMTestRules; 7 14 8 15 import 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;13 16 14 17 /** … … 35 38 Assert.fail("Should have thrown an IllegalArgumentException as we gave a null argument."); 36 39 } catch (IllegalArgumentException e) { 40 Main.trace(e); 37 41 // Was expected 38 42 } 39 43 40 44 // Add a map with no values 41 45 // => the key list is empty 42 46 Map<String, String> keys = new HashMap<>(); 43 47 44 48 // Add a map with valid values : null and short texts 45 49 // => all the items are in the keys … … 48 52 cs.setKeys(keys); 49 53 Assert.assertEquals("Both valid keys should have been put in the ChangeSet.", 2, cs.getKeys().size()); 50 54 51 55 // Add a map with too long values => IllegalArgumentException 52 56 keys = new HashMap<>(); 53 57 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++) { 55 59 b.append("x"); 56 60 } … … 60 64 Assert.fail("Should have thrown an IllegalArgumentException as we gave a too long value."); 61 65 } catch (IllegalArgumentException e) { 66 Main.trace(e); 62 67 // Was expected 63 68 } 64 65 69 } 66 70 }
Note:
See TracChangeset
for help on using the changeset viewer.