Changeset 15905 in josm
- Timestamp:
- 2020-02-23T00:29:46+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r12769 r15905 6 6 import static org.openstreetmap.josm.tools.I18n.trn; 7 7 8 import java.util.Arrays;9 8 import java.util.Collection; 10 9 import java.util.Collections; 11 import java.util.HashMap;12 10 import java.util.LinkedList; 13 11 import java.util.List; … … 107 105 public ChangePropertyCommand(Collection<? extends OsmPrimitive> objects, String key, String value) { 108 106 super(objects.iterator().next().getDataSet()); 109 this.tags = new HashMap<>(1); 110 this.tags.put(key, value); 107 this.tags = Collections.singletonMap(key, value); 111 108 init(objects); 112 109 } … … 121 118 */ 122 119 public ChangePropertyCommand(OsmPrimitive object, String key, String value) { 123 this( Arrays.asList(object), key, value);120 this(Collections.singleton(object), key, value); 124 121 } 125 122 -
trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/PrimitiveTagTransferPaster.java
r14153 r15905 7 7 import java.util.Arrays; 8 8 import java.util.Collection; 9 import java.util.Collections; 9 10 import java.util.EnumMap; 10 import java.util.HashMap;11 11 import java.util.List; 12 12 import java.util.Map; … … 52 52 List<Command> commands = new ArrayList<>(); 53 53 for (Tag tag : tagPaster.execute()) { 54 Map<String, String> tags = new HashMap<>(1); 55 tags.put(tag.getKey(), "".equals(tag.getValue()) ? null : tag.getValue()); 54 Map<String, String> tags = Collections.singletonMap(tag.getKey(), "".equals(tag.getValue()) ? null : tag.getValue()); 56 55 ChangePropertyCommand cmd = new ChangePropertyCommand(OsmDataManager.getInstance().getEditDataSet(), selection, tags); 57 56 if (cmd.getObjectsNumber() > 0) { -
trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java
r15429 r15905 6 6 import java.math.RoundingMode; 7 7 import java.util.Collection; 8 import java.util. HashMap;8 import java.util.Collections; 9 9 import java.util.HashSet; 10 10 import java.util.Iterator; … … 80 80 public String write(boolean pretty) { 81 81 StringWriter stringWriter = new StringWriter(); 82 Map<String, Object> config = new HashMap<>(1); 83 config.put(JsonGenerator.PRETTY_PRINTING, pretty); 82 Map<String, Object> config = Collections.singletonMap(JsonGenerator.PRETTY_PRINTING, pretty); 84 83 try (JsonWriter writer = Json.createWriterFactory(config).createWriter(stringWriter)) { 85 84 JsonObjectBuilder object = Json.createObjectBuilder()
Note:
See TracChangeset
for help on using the changeset viewer.