Changeset 8338 in josm
- Timestamp:
- 2015-05-07T01:27:41+02:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 94 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r8285 r8338 13 13 import java.util.LinkedList; 14 14 import java.util.List; 15 import java.util.Set; 15 16 16 17 import javax.swing.JOptionPane; … … 133 134 List<Node> nodes = new LinkedList<>(); 134 135 // fixNodes: All nodes for which the angle relative to center should not be modified 135 HashSet<Node> fixNodes = new HashSet<>();136 Set<Node> fixNodes = new HashSet<>(); 136 137 List<Way> ways = new LinkedList<>(); 137 138 EastNorth center = null; … … 156 157 Way closedWay = new Way(w); 157 158 closedWay.addNode(w.firstNode()); 158 ArrayList<Way> usedWays = new ArrayList<>(1);159 List<Way> usedWays = new ArrayList<>(1); 159 160 usedWays.add(closedWay); 160 161 nodes = collectNodesAnticlockwise(usedWays); 161 162 } else if (!ways.isEmpty() && checkWaysArePolygon(ways)) { 162 163 // Case 2 163 ArrayList<Node> inside = new ArrayList<>();164 ArrayList<Node> outside = new ArrayList<>();164 List<Node> inside = new ArrayList<>(); 165 List<Node> outside = new ArrayList<>(); 165 166 166 167 for(Node n: nodes) { … … 287 288 */ 288 289 private List<Node> collectNodesWithExternReferers(List<Way> ways) { 289 ArrayList<Node> withReferrers = new ArrayList<>();290 List<Node> withReferrers = new ArrayList<>(); 290 291 for(Way w: ways) 291 292 for(Node n: w.getNodes()) … … 301 302 */ 302 303 private List<Node> collectNodesAnticlockwise(List<Way> ways) { 303 ArrayList<Node> nodes = new ArrayList<>();304 List<Node> nodes = new ArrayList<>(); 304 305 Node firstNode = ways.get(0).firstNode(); 305 306 Node lastNode = null; -
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r8308 r8338 271 271 DataSet dataset = Main.main.getCurrentDataSet(); 272 272 if(dataset != null) { 273 ArrayList<DataSource> dataSources = new ArrayList<>(dataset.getDataSources());273 List<DataSource> dataSources = new ArrayList<>(dataset.getDataSources()); 274 274 int s = dataSources.size(); 275 275 if(s > 0) { -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r8182 r8338 11 11 import java.util.Collection; 12 12 import java.util.Collections; 13 import java.util.HashSet;14 13 import java.util.LinkedHashMap; 15 14 import java.util.LinkedHashSet; … … 184 183 List<Command> resolution = CombinePrimitiveResolverDialog.launchIfNecessary(wayTags, ways, Collections.singleton(targetWay)); 185 184 186 Li nkedList<Command> cmds = new LinkedList<>();187 Li nkedList<Way> deletedWays = new LinkedList<>(ways);185 List<Command> cmds = new LinkedList<>(); 186 List<Way> deletedWays = new LinkedList<>(ways); 188 187 deletedWays.remove(targetWay); 189 188 … … 561 560 562 561 protected Set<Node> getNodes(Stack<NodePair> pairs) { 563 HashSet<Node> nodes = new LinkedHashSet<>(2*pairs.size());562 Set<Node> nodes = new LinkedHashSet<>(2*pairs.size()); 564 563 for (NodePair pair: pairs) { 565 564 nodes.add(pair.getA()); … … 594 593 595 594 protected List<Node> buildPathFromNodePairs(Stack<NodePair> path) { 596 Li nkedList<Node> ret = new LinkedList<>();595 List<Node> ret = new LinkedList<>(); 597 596 for (NodePair pair: path) { 598 597 ret.add(pair.getA()); -
trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
r7732 r8338 164 164 public static List<ExtensionFileFilter> getImportExtensionFileFilters() { 165 165 updateAllFormatsImporter(); 166 Li nkedList<ExtensionFileFilter> filters = new LinkedList<>();166 List<ExtensionFileFilter> filters = new LinkedList<>(); 167 167 for (FileImporter importer : importers) { 168 168 filters.add(importer.filter); … … 181 181 */ 182 182 public static List<ExtensionFileFilter> getExportExtensionFileFilters() { 183 Li nkedList<ExtensionFileFilter> filters = new LinkedList<>();183 List<ExtensionFileFilter> filters = new LinkedList<>(); 184 184 for (FileExporter exporter : exporters) { 185 185 if (filters.contains(exporter.filter) || !exporter.isEnabled()) { -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r8308 r8338 1071 1071 // This seems to appear when is apply over invalid way like #9911 test-case 1072 1072 // Remove all of these way to make the next work. 1073 ArrayList<WayInPolygon> cleanMultigonWays = new ArrayList<>();1073 List<WayInPolygon> cleanMultigonWays = new ArrayList<>(); 1074 1074 for(WayInPolygon way: multigonWays) 1075 1075 if(way.way.getNodesCount() == 2 && way.way.firstNode() == way.way.lastNode()) … … 1083 1083 WayInPolygon startWay; 1084 1084 while((startWay = traverser.startNewWay()) != null) { 1085 ArrayList<WayInPolygon> path = new ArrayList<>();1085 List<WayInPolygon> path = new ArrayList<>(); 1086 1086 List<WayInPolygon> startWays = new ArrayList<>(); 1087 1087 path.add(startWay); -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r7859 r8338 283 283 284 284 // put the nodes of all ways in a set 285 final HashSet<Node> allNodes = new HashSet<>();285 final Set<Node> allNodes = new HashSet<>(); 286 286 for (WayData w : wayDataList) { 287 287 for (Node n : w.way.getNodes()) { … … 291 291 292 292 // the new x and y value for each node 293 final HashMap<Node, Double> nX = new HashMap<>();294 final HashMap<Node, Double> nY = new HashMap<>();293 final Map<Node, Double> nX = new HashMap<>(); 294 final Map<Node, Double> nY = new HashMap<>(); 295 295 296 296 // calculate the centroid of all nodes … … 314 314 final Direction[][] ORIENTATIONS = {HORIZONTAL, VERTICAL}; 315 315 for (Direction[] orientation : ORIENTATIONS){ 316 final HashSet<Node> s = new HashSet<>(allNodes);316 final Set<Node> s = new HashSet<>(allNodes); 317 317 int s_size = s.size(); 318 318 for (int dummy = 0; dummy < s_size; ++dummy) { … … 322 322 final Node dummy_n = s.iterator().next(); // pick arbitrary element of s 323 323 324 final HashSet<Node> cs = new HashSet<>(); // will contain each node that can be reached from dummy_n325 cs.add(dummy_n); 324 final Set<Node> cs = new HashSet<>(); // will contain each node that can be reached from dummy_n 325 cs.add(dummy_n); // walking only on horizontal / vertical segments 326 326 327 327 boolean somethingHappened = true; … … 349 349 } 350 350 351 final HashMap<Node, Double> nC = (orientation == HORIZONTAL) ? nY : nX;351 final Map<Node, Double> nC = (orientation == HORIZONTAL) ? nY : nX; 352 352 353 353 double average = 0; -
trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
r7005 r8338 119 119 120 120 protected Map<OsmPrimitiveType, Integer> getSourceStatistics() { 121 HashMap<OsmPrimitiveType, Integer> ret = new HashMap<>();121 Map<OsmPrimitiveType, Integer> ret = new HashMap<>(); 122 122 for (OsmPrimitiveType type: OsmPrimitiveType.dataValues()) { 123 123 if (!getSourceTagsByType(type).isEmpty()) { … … 129 129 130 130 protected Map<OsmPrimitiveType, Integer> getTargetStatistics() { 131 HashMap<OsmPrimitiveType, Integer> ret = new HashMap<>();131 Map<OsmPrimitiveType, Integer> ret = new HashMap<>(); 132 132 for (OsmPrimitiveType type: OsmPrimitiveType.dataValues()) { 133 133 int count = OsmPrimitive.getFilteredList(target, type.getOsmClass()).size(); -
trunk/src/org/openstreetmap/josm/actions/PurgeAction.java
r8308 r8338 101 101 // Add referrer, unless the object to purge is not new 102 102 // and the parent is a relation 103 HashSet<OsmPrimitive> toPurgeRecursive = new HashSet<>();103 Set<OsmPrimitive> toPurgeRecursive = new HashSet<>(); 104 104 while (!toPurge.isEmpty()) { 105 105 -
trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java
r8114 r8338 6 6 import java.util.Collection; 7 7 import java.util.Collections; 8 import java.util.Map; 8 9 import java.util.TreeMap; 9 10 … … 39 40 } 40 41 final Node n = new Node(internalPoint); 41 final TreeMap<Double, OsmPrimitive> found = new TreeMap<>();42 final Map<Double, OsmPrimitive> found = new TreeMap<>(); 42 43 for (Way w : ds.getWays()) { 43 44 if (w.isUsable() && w.isClosed() && w.isSelectable()) { -
trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java
r8285 r8338 135 135 public void extend(DataSet data) { 136 136 Collection<OsmPrimitive> currentSelection; 137 LinkedList<OsmPrimitive> selection;137 Collection<OsmPrimitive> selection; 138 138 boolean selectionChanged = false; 139 139 Way way; -
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r7509 r8338 14 14 import java.util.LinkedList; 15 15 import java.util.List; 16 import java.util.Set; 16 17 17 18 import javax.swing.JOptionPane; … … 191 192 } 192 193 193 HashSet<Node> delNodes = new HashSet<>();194 Set<Node> delNodes = new HashSet<>(); 194 195 delNodes.addAll(w.getNodes()); 195 196 delNodes.removeAll(newNodes); -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r8318 r8338 167 167 */ 168 168 private void unglueNode(ActionEvent e) { 169 Li nkedList<Command> cmds = new LinkedList<>();169 List<Command> cmds = new LinkedList<>(); 170 170 171 171 Node c = new Node(selectedNode); … … 332 332 } 333 333 Relation newRel = null; 334 HashMap<String, Integer> rolesToReAdd = null; // <role name, index>334 Map<String, Integer> rolesToReAdd = null; // <role name, index> 335 335 int i = 0; 336 336 for (RelationMember rm : r.getMembers()) { … … 361 361 */ 362 362 private void unglueWays() { 363 Li nkedList<Command> cmds = new LinkedList<>();364 Li nkedList<Node> newNodes = new LinkedList<>();363 List<Command> cmds = new LinkedList<>(); 364 List<Node> newNodes = new LinkedList<>(); 365 365 366 366 if (selectedWay == null) { … … 409 409 private boolean unglueSelfCrossingWay() { 410 410 // According to previous check, only one valid way through that node 411 Li nkedList<Command> cmds = new LinkedList<>();411 List<Command> cmds = new LinkedList<>(); 412 412 Way way = null; 413 413 for (Way w: OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) … … 416 416 } 417 417 List<Node> oldNodes = way.getNodes(); 418 ArrayList<Node> newNodes = new ArrayList<>(oldNodes.size());419 ArrayList<Node> addNodes = new ArrayList<>();418 List<Node> newNodes = new ArrayList<>(oldNodes.size()); 419 List<Node> addNodes = new ArrayList<>(); 420 420 boolean seen = false; 421 421 for (Node n: oldNodes) { … … 451 451 */ 452 452 private void unglueWays2() { 453 Li nkedList<Command> cmds = new LinkedList<>();453 List<Command> cmds = new LinkedList<>(); 454 454 List<Node> allNewNodes = new LinkedList<>(); 455 455 Way tmpWay = selectedWay; -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r7402 r8338 10 10 import java.util.LinkedList; 11 11 import java.util.List; 12 import java.util.Map; 12 13 13 14 import javax.swing.JOptionPane; … … 239 240 @Override 240 241 public void run() { 241 final HashMap<String, String> tags = new HashMap<>(layer.data.getChangeSetTags());242 final Map<String, String> tags = new HashMap<>(layer.data.getChangeSetTags()); 242 243 if (!tags.containsKey("source")) { 243 244 tags.put("source", dialog.getLastChangesetSourceFromHistory()); -
trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
r8291 r8338 69 69 70 70 protected Set<OsmPrimitive> getDeletedPrimitives(DataSet ds) { 71 HashSet<OsmPrimitive> ret = new HashSet<>();71 Set<OsmPrimitive> ret = new HashSet<>(); 72 72 for (OsmPrimitive p: ds.allPrimitives()) { 73 73 if (p.isDeleted() && !p.isNew() && p.isVisible() && p.isModified()) { … … 79 79 80 80 protected Set<OsmPrimitive> getModifiedPrimitives(Collection<OsmPrimitive> primitives) { 81 HashSet<OsmPrimitive> ret = new HashSet<>();81 Set<OsmPrimitive> ret = new HashSet<>(); 82 82 for (OsmPrimitive p: primitives) { 83 83 if (p.isNewOrUndeleted()) { … … 306 306 */ 307 307 protected Set<OsmPrimitive> getPrimitivesToCheckForParents() { 308 HashSet<OsmPrimitive> ret = new HashSet<>();308 Set<OsmPrimitive> ret = new HashSet<>(); 309 309 for (OsmPrimitive p: toUpload) { 310 310 if (p.isDeleted() && !p.isNewOrUndeleted()) { -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
r7005 r8338 126 126 */ 127 127 protected Set<OsmPrimitive> getCompletePrimitives(DataSet ds) { 128 HashSet<OsmPrimitive> ret = new HashSet<>();128 Set<OsmPrimitive> ret = new HashSet<>(); 129 129 for (OsmPrimitive primitive : ds.allPrimitives()) { 130 130 if (!primitive.isIncomplete() && !primitive.isNew()) { … … 216 216 */ 217 217 public Set<OsmPrimitive> getDownloadedPrimitives() { 218 HashSet<OsmPrimitive> ret = new HashSet<>();218 Set<OsmPrimitive> ret = new HashSet<>(); 219 219 for (DownloadTask task : tasks) { 220 220 if (task instanceof DownloadOsmTask) { … … 253 253 } 254 254 } 255 LinkedHashSet<Object> errors = new LinkedHashSet<>();255 Set<Object> errors = new LinkedHashSet<>(); 256 256 for (DownloadTask dt : tasks) { 257 257 errors.addAll(dt.getErrorObjects()); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
r7005 r8338 8 8 import java.util.LinkedHashSet; 9 9 import java.util.List; 10 import java.util.Set; 10 11 import java.util.concurrent.Future; 11 12 … … 77 78 // make sure errors are reported only once 78 79 // 79 LinkedHashSet<Object> errors = new LinkedHashSet<>();80 Set<Object> errors = new LinkedHashSet<>(); 80 81 errors.addAll(task.getErrorObjects()); 81 82 if (errors.isEmpty()) -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r8308 r8338 950 950 951 951 private static void pruneSuccsAndReverse(List<Integer> is) { 952 HashSet<Integer> is2 = new HashSet<>();952 Set<Integer> is2 = new HashSet<>(); 953 953 for (int i : is) { 954 954 if (!is2.contains(i - 1) && !is2.contains(i + 1)) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r8308 r8338 101 101 * Collection of nodes that is moved 102 102 */ 103 private ArrayList<Node> movingNodeList;103 private List<Node> movingNodeList; 104 104 105 105 /** … … 626 626 boolean segmentAngleZero = prevNode != null && Math.abs(Geometry.getCornerAngle(prevNode.getEastNorth(), initialN1en, newN1en)) < 1e-5; 627 627 boolean hasOtherWays = hasNodeOtherWays(selectedSegment.getFirstNode(), selectedSegment.way); 628 ArrayList<Node> changedNodes = new ArrayList<>();628 List<Node> changedNodes = new ArrayList<>(); 629 629 if (nodeOverlapsSegment && !alwaysCreateNodes && !hasOtherWays) { 630 630 //move existing node -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java
r8285 r8338 8 8 import java.util.HashSet; 9 9 import java.util.List; 10 import java.util.Map; 10 11 import java.util.Set; 11 12 … … 40 41 // Make a deep copy of the ways, keeping the copied ways connected 41 42 // TODO: This assumes the first/last nodes of the ways are the only possible shared nodes. 42 HashMap<Node, Node> splitNodeMap = new HashMap<>(sourceWays.size());43 Map<Node, Node> splitNodeMap = new HashMap<>(sourceWays.size()); 43 44 for (Way w : sourceWays) { 44 45 if (!splitNodeMap.containsKey(w.firstNode())) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r8318 r8338 248 248 determineMapMode(!c.isEmpty()); 249 249 250 HashSet<OsmPrimitive> newHighlights = new HashSet<>();250 Set<OsmPrimitive> newHighlights = new HashSet<>(); 251 251 252 252 virtualManager.clear(); -
trunk/src/org/openstreetmap/josm/actions/relation/SelectMembersAction.java
r7937 r8338 6 6 import java.awt.event.ActionEvent; 7 7 import java.util.HashSet; 8 import java.util.Set; 8 9 9 10 import org.openstreetmap.josm.Main; … … 17 18 */ 18 19 public class SelectMembersAction extends AbstractRelationAction { 19 20 20 21 private final boolean add; 21 22 … … 35 36 public void actionPerformed(ActionEvent e) { 36 37 if (!isEnabled() || relations.isEmpty() || !Main.isDisplayingMapView()) return; 37 38 HashSet<OsmPrimitive> members = new HashSet<>();38 39 Set<OsmPrimitive> members = new HashSet<>(); 39 40 for (Relation r: relations) { 40 41 members.addAll(r.getMemberPrimitives()); -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r8332 r8338 23 23 import java.util.List; 24 24 import java.util.Map; 25 import java.util.Set; 25 26 26 27 import javax.swing.ButtonGroup; … … 109 110 searchHistory.removeLast(); 110 111 } 111 LinkedHashSet<String> savedHistory = new LinkedHashSet<>(searchHistory.size());112 Set<String> savedHistory = new LinkedHashSet<>(searchHistory.size()); 112 113 for (SearchSetting item: searchHistory) { 113 114 savedHistory.add(item.writeToString()); -
trunk/src/org/openstreetmap/josm/actions/upload/DiscardTagsHook.java
r7937 r8338 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.util.AbstractMap;7 6 import java.util.Collection; 8 7 import java.util.HashMap; 9 8 import java.util.HashSet; 10 9 import java.util.List; 10 import java.util.Map; 11 11 12 12 import org.openstreetmap.josm.Main; … … 37 37 38 38 if (needsChange) { 39 AbstractMap<String, String> map = new HashMap<>();39 Map<String, String> map = new HashMap<>(); 40 40 for (String key : discardableKeys) { 41 41 map.put(key, null); -
trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java
r8285 r8338 190 190 191 191 for (OsmPrimitive osm : objectsToUpload) { 192 HashMap<String, String> keys = new HashMap<>(osm.getKeys());192 Map<String, String> keys = new HashMap<>(osm.getKeys()); 193 193 if(!keys.isEmpty()) { 194 194 boolean modified = false; -
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r7005 r8338 6 6 import static org.openstreetmap.josm.tools.I18n.trn; 7 7 8 import java.util.AbstractMap;9 8 import java.util.ArrayList; 10 9 import java.util.Arrays; … … 40 39 * those objects that do not have the key yet. 41 40 */ 42 private final AbstractMap<String, String> tags;41 private final Map<String, String> tags; 43 42 44 43 /** … … 48 47 * @param tags the tags to set 49 48 */ 50 public ChangePropertyCommand(Collection<? extends OsmPrimitive> objects, AbstractMap<String, String> tags) {49 public ChangePropertyCommand(Collection<? extends OsmPrimitive> objects, Map<String, String> tags) { 51 50 this.objects = new LinkedList<>(); 52 51 this.tags = tags; -
trunk/src/org/openstreetmap/josm/command/PurgeCommand.java
r7005 r8338 201 201 List<Relation> outR = new ArrayList<>(inR.size()); 202 202 203 HashMap<Relation, Integer> numChilds = new HashMap<>();203 Map<Relation, Integer> numChilds = new HashMap<>(); 204 204 205 205 // calculate initial number of childs -
trunk/src/org/openstreetmap/josm/data/APIDataSet.java
r8291 r8338 185 185 */ 186 186 public List<OsmPrimitive> getPrimitives() { 187 Li nkedList<OsmPrimitive> ret = new LinkedList<>();187 List<OsmPrimitive> ret = new LinkedList<>(); 188 188 ret.addAll(toAdd); 189 189 ret.addAll(toUpdate); … … 218 218 */ 219 219 public void adjustRelationUploadOrder() throws CyclicUploadDependencyException{ 220 Li nkedList<OsmPrimitive> newToAdd = new LinkedList<>();220 List<OsmPrimitive> newToAdd = new LinkedList<>(); 221 221 newToAdd.addAll(Utils.filteredCollection(toAdd, Node.class)); 222 222 newToAdd.addAll(Utils.filteredCollection(toAdd, Way.class)); … … 231 231 toAdd = newToAdd; 232 232 233 Li nkedList<OsmPrimitive> newToDelete = new LinkedList<>();233 List<OsmPrimitive> newToDelete = new LinkedList<>(); 234 234 graph = new RelationUploadDependencyGraph(Utils.filteredCollection(toDelete, Relation.class), false); 235 235 newToDelete.addAll(graph.computeUploadOrder()); -
trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
r8308 r8338 21 21 import java.util.Map; 22 22 import java.util.Map.Entry; 23 import java.util.Set; 23 24 import java.util.SortedMap; 24 25 import java.util.TreeMap; … … 202 203 */ 203 204 public static void exportPreferencesKeysToFile(String filename, boolean append, String... keys) { 204 HashSet<String> keySet = new HashSet<>();205 Set<String> keySet = new HashSet<>(); 205 206 Collections.addAll(keySet, keys); 206 207 exportPreferencesKeysToFile(filename, append, keySet); -
trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java
r8291 r8338 320 320 */ 321 321 public Set<OsmPrimitive> getMyConflictParties() { 322 HashSet<OsmPrimitive> ret = new HashSet<>();322 Set<OsmPrimitive> ret = new HashSet<>(); 323 323 for (Conflict<?> c: conflicts) { 324 324 ret.add(c.getMy()); … … 326 326 return ret; 327 327 } 328 328 329 /** 329 330 * Replies the set of {@link OsmPrimitive} which participate in the role … … 334 335 */ 335 336 public Set<OsmPrimitive> getTheirConflictParties() { 336 HashSet<OsmPrimitive> ret = new HashSet<>();337 Set<OsmPrimitive> ret = new HashSet<>(); 337 338 for (Conflict<?> c: conflicts) { 338 339 ret.add(c.getTheir()); -
trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java
r7005 r8338 86 86 87 87 public static void saveBookmarks() { 88 Li nkedList<Collection<String>> coll = new LinkedList<>();88 List<Collection<String>> coll = new LinkedList<>(); 89 89 for (OffsetBookmark b : allBookmarks) { 90 90 coll.add(b.getInfoArray()); -
trunk/src/org/openstreetmap/josm/data/osm/ChangesetCache.java
r7079 r8338 48 48 private final Map<Integer, Changeset> cache = new HashMap<>(); 49 49 50 private final CopyOnWriteArrayList<ChangesetCacheListener> listeners = 51 new CopyOnWriteArrayList<>(); 50 private final CopyOnWriteArrayList<ChangesetCacheListener> listeners = new CopyOnWriteArrayList<>(); 52 51 53 52 private ChangesetCache() { -
trunk/src/org/openstreetmap/josm/data/osm/ChangesetDataSet.java
r8291 r8338 116 116 public Set<HistoryOsmPrimitive> getPrimitivesByModificationType(ChangesetModificationType cmt) { 117 117 CheckParameterUtil.ensureParameterNotNull(cmt,"cmt"); 118 HashSet<HistoryOsmPrimitive> ret = new HashSet<>();118 Set<HistoryOsmPrimitive> ret = new HashSet<>(); 119 119 for (Entry<PrimitiveId, ChangesetModificationType> entry: modificationTypes.entrySet()) { 120 120 if (entry.getValue().equals(cmt)) { -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r8291 r8338 729 729 boolean changed; 730 730 synchronized (selectionLock) { 731 LinkedHashSet<OsmPrimitive> oldSelection = new LinkedHashSet<>(selectedPrimitives);731 Set<OsmPrimitive> oldSelection = new LinkedHashSet<>(selectedPrimitives); 732 732 selectedPrimitives = new LinkedHashSet<>(); 733 733 addSelected(selection, false); … … 878 878 try { 879 879 DataSet ds = new DataSet(); 880 HashMap<OsmPrimitive, OsmPrimitive> primMap = new HashMap<>();880 Map<OsmPrimitive, OsmPrimitive> primMap = new HashMap<>(); 881 881 for (Node n : nodes) { 882 882 Node newNode = new Node(n); -
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r8291 r8338 264 264 if (target == null) 265 265 throw new IllegalStateException(tr("Missing merge target for relation with id {0}", source.getUniqueId())); 266 Li nkedList<RelationMember> newMembers = new LinkedList<>();266 List<RelationMember> newMembers = new LinkedList<>(); 267 267 for (RelationMember sourceMember : source.getMembers()) { 268 268 OsmPrimitive targetMember = getMergeTarget(sourceMember.getMember()); -
trunk/src/org/openstreetmap/josm/data/osm/NoteData.java
r8224 r8338 7 7 import java.util.Comparator; 8 8 import java.util.Date; 9 import java.util.List; 9 10 import java.util.Map; 10 11 … … 113 114 */ 114 115 public Collection<Note> getSortedNotes() { 115 final ArrayList<Note> list = new ArrayList<>(noteList);116 final List<Note> list = new ArrayList<>(noteList); 116 117 Collections.sort(list, comparator); 117 118 return list; -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r8291 r8338 161 161 */ 162 162 public static Set<OsmPrimitive> getReferrer(Collection<? extends OsmPrimitive> primitives) { 163 HashSet<OsmPrimitive> ret = new HashSet<>();163 Set<OsmPrimitive> ret = new HashSet<>(); 164 164 if (primitives == null || primitives.isEmpty()) return ret; 165 165 for (OsmPrimitive p: primitives) { … … 173 173 */ 174 174 public static final Predicate<OsmPrimitive> isUsablePredicate = new Predicate<OsmPrimitive>() { 175 @Override public boolean evaluate(OsmPrimitive primitive) { 175 @Override 176 public boolean evaluate(OsmPrimitive primitive) { 176 177 return primitive.isUsable(); 177 178 } … … 179 180 180 181 public static final Predicate<OsmPrimitive> isSelectablePredicate = new Predicate<OsmPrimitive>() { 181 @Override public boolean evaluate(OsmPrimitive primitive) { 182 @Override 183 public boolean evaluate(OsmPrimitive primitive) { 182 184 return primitive.isSelectable(); 183 185 } … … 665 667 public static Collection<String> getUninterestingKeys() { 666 668 if (uninteresting == null) { 667 Li nkedList<String> l = new LinkedList<>(Arrays.asList(669 List<String> l = new LinkedList<>(Arrays.asList( 668 670 "source", "source_ref", "source:", "comment", 669 671 "converted_by", "watch", "watch:", … … 1364 1366 */ 1365 1367 public static Set<Relation> getParentRelations(Collection<? extends OsmPrimitive> primitives) { 1366 HashSet<Relation> ret = new HashSet<>();1368 Set<Relation> ret = new HashSet<>(); 1367 1369 for (OsmPrimitive w : primitives) { 1368 1370 ret.addAll(OsmPrimitive.getFilteredList(w.getReferrers(), Relation.class)); -
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r8318 r8338 477 477 } 478 478 479 public ArrayList<T> toArrayList() {480 ArrayList<T> a = new ArrayList<>();479 public List<T> toList() { 480 List<T> a = new ArrayList<>(); 481 481 for (T n : this) { 482 482 a.add(n); … … 487 487 @Override 488 488 public Object[] toArray() { 489 return this.to ArrayList().toArray();489 return this.toList().toArray(); 490 490 } 491 491 492 492 @Override 493 493 public <A> A[] toArray(A[] template) { 494 return this.to ArrayList().toArray(template);494 return this.toList().toArray(template); 495 495 } 496 496 -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r8291 r8338 388 388 */ 389 389 public Set<OsmPrimitive> getMemberPrimitives() { 390 HashSet<OsmPrimitive> ret = new HashSet<>();390 Set<OsmPrimitive> ret = new HashSet<>(); 391 391 RelationMember[] members = this.members; 392 392 for (RelationMember m: members) { -
trunk/src/org/openstreetmap/josm/data/osm/SimplePrimitiveId.java
r8308 r8338 97 97 */ 98 98 public static List<SimplePrimitiveId> fuzzyParse(String s) { 99 final ArrayList<SimplePrimitiveId> ids = new ArrayList<>();99 final List<SimplePrimitiveId> ids = new ArrayList<>(); 100 100 final Matcher m = ID_PATTERN.matcher(s); 101 101 while (m.find()) { -
trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java
r8291 r8338 499 499 */ 500 500 public Set<String> getKeys() { 501 HashSet<String> ret = new HashSet<>();501 Set<String> ret = new HashSet<>(); 502 502 for (Tag tag: tags) { 503 503 ret.add(tag.getKey()); … … 512 512 */ 513 513 public Set<String> getKeysWithMultipleValues() { 514 HashMap<String, Integer> counters = new HashMap<>();514 Map<String, Integer> counters = new HashMap<>(); 515 515 for (Tag tag: tags) { 516 516 Integer v = counters.get(tag.getKey()); … … 557 557 */ 558 558 public Set<String> getValues() { 559 HashSet<String> ret = new HashSet<>();559 Set<String> ret = new HashSet<>(); 560 560 for (Tag tag: tags) { 561 561 ret.add(tag.getValue()); … … 573 573 */ 574 574 public Set<String> getValues(String key) { 575 HashSet<String> ret = new HashSet<>();575 Set<String> ret = new HashSet<>(); 576 576 if (key == null) return ret; 577 577 for (Tag tag: tags) { -
trunk/src/org/openstreetmap/josm/data/osm/TigerUtils.java
r7509 r8338 46 46 47 47 public static String combineTags(String name, Set<String> values) { 48 TreeSet<Object> resultSet = new TreeSet<>();48 Set<Object> resultSet = new TreeSet<>(); 49 49 for (String value: values) { 50 50 String[] parts = value.split(":"); -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r8325 r8338 168 168 */ 169 169 public Set<Node> getNeighbours(Node node) { 170 HashSet<Node> neigh = new HashSet<>();170 Set<Node> neigh = new HashSet<>(); 171 171 172 172 if (node == null) return neigh; -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java
r8291 r8338 9 9 import java.util.List; 10 10 import java.util.Map; 11 import java.util.Set; 11 12 import java.util.concurrent.CopyOnWriteArrayList; 12 13 … … 187 188 188 189 public Collection<Long> getChangesetIds() { 189 final HashSet<Long> ids = new HashSet<>();190 final Set<Long> ids = new HashSet<>(); 190 191 for (Collection<HistoryOsmPrimitive> i : data.values()) { 191 192 for (HistoryOsmPrimitive j : i) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r7005 r8338 386 386 if (!isFixable(testError)) return null; 387 387 Collection<OsmPrimitive> sel = new LinkedList<>(testError.getPrimitives()); 388 LinkedHashSet<Node> nodes = new LinkedHashSet<>(OsmPrimitive.getFilteredList(sel, Node.class));388 Set<Node> nodes = new LinkedHashSet<>(OsmPrimitive.getFilteredList(sel, Node.class)); 389 389 390 390 // Filter nodes that have already been deleted (see #5764 and #5773) -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
r7937 r8338 229 229 if (testError.getCode() == SAME_RELATION) return null; 230 230 Collection<? extends OsmPrimitive> sel = testError.getPrimitives(); 231 HashSet<Relation> relFix = new HashSet<>();231 Set<Relation> relFix = new HashSet<>(); 232 232 233 233 for (OsmPrimitive osm : sel) … … 292 292 // We fix it only if there is no more than one relation that is relation member. 293 293 Collection<? extends OsmPrimitive> sel = testError.getPrimitives(); 294 HashSet<Relation> relations = new HashSet<>();294 Set<Relation> relations = new HashSet<>(); 295 295 296 296 for (OsmPrimitive osm : sel) -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
r7721 r8338 237 237 public Command fixError(TestError testError) { 238 238 Collection<? extends OsmPrimitive> sel = testError.getPrimitives(); 239 HashSet<Way> ways = new HashSet<>();239 Set<Way> ways = new HashSet<>(); 240 240 241 241 for (OsmPrimitive osm : sel) { … … 305 305 // We fix it only if there is no more than one way that is relation member. 306 306 Collection<? extends OsmPrimitive> sel = testError.getPrimitives(); 307 HashSet<Way> ways = new HashSet<>();307 Set<Way> ways = new HashSet<>(); 308 308 309 309 for (OsmPrimitive osm : sel) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java
r8285 r8338 12 12 import java.util.Locale; 13 13 import java.util.Map; 14 import java.util.Set; 14 15 15 16 import org.openstreetmap.josm.command.ChangePropertyCommand; … … 152 153 } 153 154 154 final HashSet<OsmPrimitive> referrers = new HashSet<>();155 final Set<OsmPrimitive> referrers = new HashSet<>(); 155 156 156 157 if (way.isClosed()) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java
r8239 r8338 6 6 import java.util.HashSet; 7 7 import java.util.Map.Entry; 8 import java.util.Set; 8 9 import java.util.regex.Pattern; 9 10 … … 60 61 @Override 61 62 public void check(OsmPrimitive p) { 62 HashSet<String> names = new HashSet<>();63 Set<String> names = new HashSet<>(); 63 64 64 65 for (Entry<String, String> entry : p.getKeys().entrySet()) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
r7941 r8338 10 10 import java.util.HashMap; 11 11 import java.util.LinkedList; 12 import java.util.List; 12 13 import java.util.Map; 13 14 … … 84 85 85 86 private static class RolePreset { 86 public RolePreset(Li nkedList<Role> roles, String name) {87 public RolePreset(List<Role> roles, String name) { 87 88 this.roles = roles; 88 89 this.name = name; 89 90 } 90 private final Li nkedList<Role> roles;91 private final List<Role> roles; 91 92 private final String name; 92 93 } … … 151 152 for(Role role: r.roles) { 152 153 String key = role.key; 153 Li nkedList<Role> roleGroup = null;154 List<Role> roleGroup = null; 154 155 if (allroles.containsKey(key)) { 155 156 roleGroup = allroles.get(key).roles; -
trunk/src/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWay.java
r7005 r8338 6 6 import java.util.Arrays; 7 7 import java.util.HashSet; 8 import java.util.Set; 8 9 9 10 import org.openstreetmap.josm.data.osm.Node; … … 29 30 } 30 31 31 @Override public void visit(Way w) { 32 HashSet<Node> nodes = new HashSet<>(); 32 @Override 33 public void visit(Way w) { 34 Set<Node> nodes = new HashSet<>(); 33 35 34 36 for (int i = 1; i < w.getNodesCount() - 1; i++) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java
r7848 r8338 40 40 private MultiMap<Way, Way> errorWays; 41 41 42 private ArrayList<NormalizeRule> rules = new ArrayList<NormalizeRule>();42 private List<NormalizeRule> rules = new ArrayList<NormalizeRule>(); 43 43 44 44 /** -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r8308 r8338 684 684 private Map<Double, List<Node>> getNearestNodesImpl(Point p, 685 685 Predicate<OsmPrimitive> predicate) { 686 TreeMap<Double, List<Node>> nearestMap = new TreeMap<>();686 Map<Double, List<Node>> nearestMap = new TreeMap<>(); 687 687 DataSet ds = getCurrentDataSet(); 688 688 -
trunk/src/org/openstreetmap/josm/gui/actionsupport/DeleteFromRelationConfirmationDialog.java
r8308 r8338 229 229 230 230 public Set<OsmPrimitive> getObjectsToDelete() { 231 HashSet<OsmPrimitive> ret = new HashSet<>();231 Set<OsmPrimitive> ret = new HashSet<>(); 232 232 for (RelationToChildReference ref: data) { 233 233 ret.add(ref.getChild()); … … 241 241 242 242 public Set<OsmPrimitive> getParentRelations() { 243 HashSet<OsmPrimitive> ret = new HashSet<>();243 Set<OsmPrimitive> ret = new HashSet<>(); 244 244 for (RelationToChildReference ref: data) { 245 245 ret.add(ref.getParent()); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
r8308 r8338 731 731 private final transient List<T> entries; 732 732 733 public EntriesSelectionModel( ArrayList<T> nodes) {733 public EntriesSelectionModel(List<T> nodes) { 734 734 this.entries = nodes; 735 735 } -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java
r8308 r8338 253 253 254 254 protected List<Command> buildTagChangeCommand(OsmPrimitive primitive, TagCollection tc) { 255 Li nkedList<Command> cmds = new LinkedList<>();255 List<Command> cmds = new LinkedList<>(); 256 256 for (String key : tc.getKeys()) { 257 257 if (tc.hasUniqueEmptyValue(key)) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r8308 r8338 287 287 288 288 protected Map<User, Integer> computeStatistics(Collection<? extends OsmPrimitive> primitives) { 289 HashMap<User, Integer> ret = new HashMap<>();289 Map<User, Integer> ret = new HashMap<>(); 290 290 if (primitives == null || primitives.isEmpty()) return ret; 291 291 for (OsmPrimitive primitive: primitives) { … … 354 354 355 355 public List<User> getSelectedUsers(int[] rows) { 356 Li nkedList<User> ret = new LinkedList<>();356 List<User> ret = new LinkedList<>(); 357 357 if (rows == null || rows.length == 0) return ret; 358 358 for (int row: rows) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r8308 r8338 190 190 Set<DefaultMutableTreeNode> processedNodes = new HashSet<>(); 191 191 192 Li nkedList<TestError> errorsToFix = new LinkedList<>();192 List<TestError> errorsToFix = new LinkedList<>(); 193 193 for (TreePath path : selectionPaths) { 194 194 DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent(); … … 548 548 tree.setFilter(null); 549 549 } 550 HashSet<OsmPrimitive> filter = new HashSet<>(newSelection); 551 tree.setFilter(filter); 550 tree.setFilter(new HashSet<>(newSelection)); 552 551 } 553 552 -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetHeaderDownloadTask.java
r8291 r8338 65 65 } 66 66 67 HashSet<Integer> ids = new HashSet<>();67 Set<Integer> ids = new HashSet<>(); 68 68 for (Changeset cs: changesets) { 69 69 if (cs == null || cs.isNew()) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r8308 r8338 608 608 final Map<String, String> tags = new HashMap<>(); 609 609 valueCount.clear(); 610 EnumSet<TaggingPresetType> types = EnumSet.noneOf(TaggingPresetType.class);610 Set<TaggingPresetType> types = EnumSet.noneOf(TaggingPresetType.class); 611 611 for (OsmPrimitive osm : newSel) { 612 612 types.add(TaggingPresetType.forPrimitive(osm)); … … 619 619 v.put(value, v.containsKey(value) ? v.get(value) + 1 : 1); 620 620 } else { 621 TreeMap<String, Integer> v = new TreeMap<>();621 Map<String, Integer> v = new TreeMap<>(); 622 622 v.put(value, 1); 623 623 valueCount.put(key, v); … … 753 753 int row = tagTable.getSelectedRow(); 754 754 if (row == -1) return null; 755 TreeMap<String, Integer> map = (TreeMap<String, Integer>) tagData.getValueAt(row, 1);755 Map<String, Integer> map = (TreeMap<String, Integer>) tagData.getValueAt(row, 1); 756 756 return new Tag( 757 757 tagData.getValueAt(row, 0).toString(), … … 905 905 protected void deleteTags(int[] rows){ 906 906 // convert list of rows to HashMap (and find gap for nextKey) 907 HashMap<String, String> tags = new HashMap<>(rows.length);907 Map<String, String> tags = new HashMap<>(rows.length); 908 908 int nextKeyIndex = rows[0]; 909 909 for (int row : rows) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r8308 r8338 258 258 if (selection == null || selection.length == 0) 259 259 return; 260 HashSet<Relation> relations = new HashSet<>();260 Set<Relation> relations = new HashSet<>(); 261 261 for (TreePath aSelection : selection) { 262 262 relations.add((Relation) aSelection.getLastPathComponent()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r8318 r8338 514 514 */ 515 515 public Set<OsmPrimitive> getChildPrimitives(Collection<? extends OsmPrimitive> referenceSet) { 516 HashSet<OsmPrimitive> ret = new HashSet<>();516 Set<OsmPrimitive> ret = new HashSet<>(); 517 517 if (referenceSet == null) return null; 518 518 for (RelationMember m: members) { … … 606 606 if (primitives == null || primitives.isEmpty()) 607 607 return false; 608 HashSet<OsmPrimitive> referrers = new HashSet<>();608 Set<OsmPrimitive> referrers = new HashSet<>(); 609 609 for (RelationMember member : members) { 610 610 referrers.add(member.getMember()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java
r8285 r8338 233 233 private Integer popBackwardOnewayPart(int way){ 234 234 if (lastOnewayNode != null) { 235 TreeSet<Node> nodes = new TreeSet<>();235 Set<Node> nodes = new TreeSet<>(); 236 236 if (onewayReverseMap.ways.containsKey(way)) { 237 237 nodes.addAll(onewayReverseMap.ways.get(way)); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java
r8259 r8338 175 175 } 176 176 177 for (Li nkedList<Integer> tmpGroup : allGroups) {177 for (List<Integer> tmpGroup : allGroups) { 178 178 for (Integer p : tmpGroup) { 179 179 newMembers.add(defaultMembers.get(p)); -
trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java
r8291 r8338 158 158 Collection<Collection<String>> args = Main.pref.getArray("bookmarks", null); 159 159 if(args != null) { 160 Li nkedList<Bookmark> bookmarks = new LinkedList<>();160 List<Bookmark> bookmarks = new LinkedList<>(); 161 161 for(Collection<String> entry : args) { 162 162 try { … … 178 178 */ 179 179 public final void save() { 180 Li nkedList<Collection<String>> coll = new LinkedList<>();180 List<Collection<String>> coll = new LinkedList<>(); 181 181 for (Object o : ((DefaultListModel<Bookmark>)getModel()).toArray()) { 182 182 String[] array = new String[5]; -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r8308 r8338 10 10 import java.util.List; 11 11 import java.util.Observable; 12 import java.util.Set; 12 13 13 14 import javax.swing.JTable; … … 535 536 536 537 protected void initKeyList() { 537 HashSet<String> keySet = new HashSet<>();538 Set<String> keySet = new HashSet<>(); 538 539 if (current != null) { 539 540 keySet.addAll(current.getTags().keySet()); -
trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java
r8221 r8338 190 190 return null; 191 191 } 192 ArrayList<PrimitiveId> downloaded = new ArrayList<>(ids);192 List<PrimitiveId> downloaded = new ArrayList<>(ids); 193 193 downloaded.removeAll(mainTask.getMissingPrimitives()); 194 194 return downloaded; -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r8332 r8338 27 27 import java.util.List; 28 28 import java.util.Map; 29 import java.util.Set; 29 30 import java.util.concurrent.Callable; 30 31 import java.util.concurrent.CopyOnWriteArrayList; … … 548 549 GpxData gpxData = new GpxData(); 549 550 gpxData.storageFile = file; 550 HashSet<Node> doneNodes = new HashSet<>();551 Set<Node> doneNodes = new HashSet<>(); 551 552 waysToGpxData(data.getWays(), gpxData, doneNodes); 552 553 nodesToGpxData(data.getNodes(), gpxData, doneNodes); … … 554 555 } 555 556 556 private static void waysToGpxData(Collection<Way> ways, GpxData gpxData, HashSet<Node> doneNodes) {557 private static void waysToGpxData(Collection<Way> ways, GpxData gpxData, Set<Node> doneNodes) { 557 558 for (Way w : ways) { 558 559 if (!w.isUsable()) { … … 632 633 } 633 634 634 private static void nodesToGpxData(Collection<Node> nodes, GpxData gpxData, HashSet<Node> doneNodes) {635 private static void nodesToGpxData(Collection<Node> nodes, GpxData gpxData, Set<Node> doneNodes) { 635 636 List<Node> sortedNodes = new ArrayList<>(nodes); 636 637 sortedNodes.removeAll(doneNodes); … … 645 646 646 647 private static void addIntegerIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String ... osmKeys) { 647 ArrayList<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys));648 List<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys)); 648 649 possibleKeys.add(0, gpxKey); 649 650 for (String key : possibleKeys) { … … 668 669 669 670 private static void addDoubleIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String ... osmKeys) { 670 ArrayList<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys));671 List<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys)); 671 672 possibleKeys.add(0, gpxKey); 672 673 for (String key : possibleKeys) { … … 690 691 691 692 private static void addStringIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String ... osmKeys) { 692 ArrayList<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys));693 List<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys)); 693 694 possibleKeys.add(0, gpxKey); 694 695 for (String key : possibleKeys) { -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportImagesAction.java
r8308 r8338 59 59 File[] sel = fc.getSelectedFiles(); 60 60 if (sel != null && sel.length > 0) { 61 Li nkedList<File> files = new LinkedList<>();61 List<File> files = new LinkedList<>(); 62 62 addRecursiveFiles(files, sel); 63 63 importer.importDataHandleExceptions(files, NullProgressMonitor.INSTANCE); -
trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
r8332 r8338 196 196 public Cascade clone() { 197 197 @SuppressWarnings("unchecked") 198 HashMap<String, Object> clonedProp = (HashMap<String, Object>) ((HashMap) this.prop).clone();198 Map<String, Object> clonedProp = (Map<String, Object>) ((HashMap) this.prop).clone(); 199 199 Cascade c = new Cascade(); 200 200 c.prop = clonedProp; -
trunk/src/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategy.java
r7005 r8338 188 188 nameTags = Collections.emptyList(); 189 189 } 190 ArrayList<String> result = new ArrayList<>();190 List<String> result = new ArrayList<>(); 191 191 for(String tag: nameTags) { 192 192 if (tag == null) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r8297 r8338 146 146 } 147 147 148 public static final EnumSet<Op> COMPARISON_OPERATERS =149 EnumSet.of(Op.GREATER_OR_EQUAL, Op.GREATER, Op.LESS_OR_EQUAL, Op.LESS);150 151 148 /** 152 149 * Most common case of a KeyValueCondition. … … 223 220 224 221 public final Pattern pattern; 225 public static final EnumSet<Op> SUPPORTED_OPS = EnumSet.of(Op.REGEX, Op.NREGEX);222 public static final Set<Op> SUPPORTED_OPS = EnumSet.of(Op.REGEX, Op.NREGEX); 226 223 227 224 public KeyValueRegexpCondition(String k, String v, Op op, boolean considerValAsKey) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r8318 r8338 185 185 * primitive. This includes all key=* rules. 186 186 */ 187 HashMap<String, BitSet> specialRules = new HashMap<>();187 Map<String, BitSet> specialRules = new HashMap<>(); 188 188 189 189 public void addForKey(int ruleIndex) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
r7596 r8338 186 186 private void get(OsmPrimitive primitive, boolean closed, WayPrototypesRecord p, Double scale, MultiCascade mc) { 187 187 String lineIdx = null; 188 HashMap<String, LinemodPrototype> overlayMap = new HashMap<>();188 Map<String, LinemodPrototype> overlayMap = new HashMap<>(); 189 189 boolean isNotArea = primitive.isKeyFalse("area"); 190 190 for (String key : primitive.keySet()) { -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r8308 r8338 1071 1071 */ 1072 1072 public void addCustomButton(String definitionText, int preferredIndex, boolean removeIfExists) { 1073 Li nkedList<String> t = new LinkedList<>(getToolString());1073 List<String> t = new LinkedList<>(getToolString()); 1074 1074 if (t.contains(definitionText)) { 1075 1075 if (!removeIfExists) return; // do nothing -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r8018 r8338 286 286 pnlPluginUpdatePolicy.rememberInPreferences(); 287 287 if (model.isActivePluginsChanged()) { 288 Li nkedList<String> l = new LinkedList<>(model.getSelectedPluginNames());288 List<String> l = new LinkedList<>(model.getSelectedPluginNames()); 289 289 Collections.sort(l); 290 290 Main.pref.putCollection("plugins", l); -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
r8308 r8338 310 310 if (tags == null) 311 311 return; 312 ArrayList<TagModel> toDelete = new ArrayList<>();312 List<TagModel> toDelete = new ArrayList<>(); 313 313 for (int tagIdx : tagIndices) { 314 314 TagModel tag = tags.get(tagIdx); … … 488 488 489 489 List<String> currentkeys = getKeys(); 490 ArrayList<Command> commands = new ArrayList<>();490 List<Command> commands = new ArrayList<>(); 491 491 492 492 for (OsmPrimitive primitive : primitives) { … … 512 512 */ 513 513 public List<String> getKeys() { 514 ArrayList<String> keys = new ArrayList<>();514 List<String> keys = new ArrayList<>(); 515 515 for (TagModel tag: tags) { 516 516 if (!tag.getName().trim().isEmpty()) { -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r8318 r8338 20 20 import java.util.List; 21 21 import java.util.Map; 22 import java.util.Set; 22 23 23 24 import javax.swing.AbstractAction; … … 85 86 * The types as preparsed collection. 86 87 */ 87 public EnumSet<TaggingPresetType> types;88 public Set<TaggingPresetType> types; 88 89 public transient List<TaggingPresetItem> data = new LinkedList<>(); 89 90 public transient Roles roles; … … 502 503 super("", ImageProvider.get("dialogs", "pin")); 503 504 putValue(SHORT_DESCRIPTION, tr("Add or remove toolbar button")); 504 Li nkedList<String> t = new LinkedList<>(ToolbarPreferences.getToolString());505 List<String> t = new LinkedList<>(ToolbarPreferences.getToolString()); 505 506 toolbarIndex = t.indexOf(getToolbarString()); 506 507 putValue(SELECTED_KEY, toolbarIndex >= 0); -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r8332 r8338 30 30 import java.util.Map; 31 31 import java.util.Map.Entry; 32 import java.util.Set; 33 import java.util.SortedSet; 32 34 import java.util.TreeSet; 33 35 … … 81 83 82 84 // cache the parsing of types using a LRU cache (http://java-planet.blogspot.com/2005/08/how-to-set-up-simple-lru-cache-using.html) 83 private static final Map<String, EnumSet<TaggingPresetType>> TYPE_CACHE = new LinkedHashMap<>(16, 1.1f, true);85 private static final Map<String,Set<TaggingPresetType>> TYPE_CACHE = new LinkedHashMap<>(16, 1.1f, true); 84 86 85 87 /** … … 167 169 168 170 public static class Role { 169 public EnumSet<TaggingPresetType> types;171 public Set<TaggingPresetType> types; 170 172 public String key; 171 173 /** The text to display */ … … 290 292 291 293 public static class Usage { 292 private TreeSet<String> values;294 private SortedSet<String> values; 293 295 private boolean hadKeys = false; 294 296 private boolean hadEmpty = false; … … 1396 1398 } else { 1397 1399 String s = o.toString(); 1398 TreeSet<String> parts = new TreeSet<>(Arrays.asList(s.split(delimiter)));1400 Set<String> parts = new TreeSet<>(Arrays.asList(s.split(delimiter))); 1399 1401 ListModel<PresetListEntry> lm = getModel(); 1400 1402 int[] intParts = new int[lm.getSize()]; … … 1429 1431 } 1430 1432 1431 public static EnumSet<TaggingPresetType> getType(String types) throws SAXException {1433 public static Set<TaggingPresetType> getType(String types) throws SAXException { 1432 1434 if (TYPE_CACHE.containsKey(types)) 1433 1435 return TYPE_CACHE.get(types); 1434 EnumSet<TaggingPresetType> result = EnumSet.noneOf(TaggingPresetType.class);1436 Set<TaggingPresetType> result = EnumSet.noneOf(TaggingPresetType.class); 1435 1437 for (String type : Arrays.asList(types.split(","))) { 1436 1438 try { -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java
r8126 r8338 287 287 */ 288 288 public static Collection<TaggingPreset> readAll(Collection<String> sources, boolean validate, boolean displayErrMsg) { 289 Li nkedList<TaggingPreset> allPresets = new LinkedList<>();289 List<TaggingPreset> allPresets = new LinkedList<>(); 290 290 for(String source : sources) { 291 291 try { -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchPrimitiveDialog.java
r8126 r8338 7 7 import java.awt.event.KeyEvent; 8 8 import java.util.HashSet; 9 import java.util.Set; 9 10 10 11 import org.openstreetmap.josm.Main; … … 62 63 TaggingPreset preset = selector.getSelectedPreset(); 63 64 if (preset != null) { 64 final HashSet<OsmPrimitive> matching = new HashSet<>(Utils.filter(Main.main.getCurrentDataSet().allPrimitives(), preset));65 final Set<OsmPrimitive> matching = new HashSet<>(Utils.filter(Main.main.getCurrentDataSet().allPrimitives(), preset)); 65 66 Main.main.getCurrentDataSet().setSelected(matching); 66 67 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java
r8308 r8338 23 23 import java.util.List; 24 24 import java.util.Objects; 25 import java.util.Set; 25 26 26 27 import javax.swing.AbstractAction; … … 74 75 private final JCheckBox ckOnlyApplicable; 75 76 private final JCheckBox ckSearchInTags; 76 private final EnumSet<TaggingPresetType> typesInSelection = EnumSet.noneOf(TaggingPresetType.class);77 private final Set<TaggingPresetType> typesInSelection = EnumSet.noneOf(TaggingPresetType.class); 77 78 private boolean typesInSelectionDirty = true; 78 79 private final transient PresetClassifications classifications = new PresetClassifications(); … … 356 357 private final List<PresetClassification> classifications = new ArrayList<>(); 357 358 358 public List<PresetClassification> getMatchingPresets(String searchText, boolean onlyApplicable, boolean inTags, EnumSet<TaggingPresetType> presetTypes, final Collection<? extends OsmPrimitive> selectedPrimitives) { 359 public List<PresetClassification> getMatchingPresets(String searchText, boolean onlyApplicable, boolean inTags, 360 Set<TaggingPresetType> presetTypes, final Collection<? extends OsmPrimitive> selectedPrimitives) { 359 361 final String[] groupWords; 360 362 final String[] nameWords; … … 371 373 } 372 374 373 public List<PresetClassification> getMatchingPresets(String[] groupWords, String[] nameWords, boolean onlyApplicable, boolean inTags, EnumSet<TaggingPresetType> presetTypes, final Collection<? extends OsmPrimitive> selectedPrimitives) { 375 public List<PresetClassification> getMatchingPresets(String[] groupWords, String[] nameWords, boolean onlyApplicable, 376 boolean inTags, Set<TaggingPresetType> presetTypes, final Collection<? extends OsmPrimitive> selectedPrimitives) { 374 377 375 378 final List<PresetClassification> result = new ArrayList<>(); … … 451 454 } 452 455 453 private EnumSet<TaggingPresetType> getTypesInSelection() {456 private Set<TaggingPresetType> getTypesInSelection() { 454 457 if (typesInSelectionDirty) { 455 458 synchronized (typesInSelection) { -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresets.java
r7937 r8338 5 5 import java.util.Collection; 6 6 import java.util.HashMap; 7 import java.util.Map; 7 8 8 9 import javax.swing.JMenu; … … 51 52 } else { 52 53 AutoCompletionManager.cachePresets(taggingPresets); 53 HashMap<TaggingPresetMenu,JMenu> submenus = new HashMap<>();54 Map<TaggingPresetMenu,JMenu> submenus = new HashMap<>(); 54 55 for (final TaggingPreset p : taggingPresets) { 55 56 JMenu m = p.group != null ? submenus.get(p.group) : Main.main.menu.presetsMenu; -
trunk/src/org/openstreetmap/josm/gui/util/AdvancedKeyPressDetector.java
r8072 r8338 13 13 import java.awt.event.KeyEvent; 14 14 import java.util.ArrayList; 15 import java.util.List; 15 16 import java.util.Set; 16 17 import java.util.TreeSet; … … 35 36 private Timer timer; 36 37 37 private final ArrayList<KeyPressReleaseListener> keyListeners = new ArrayList<>();38 private final ArrayList<ModifierListener> modifierListeners = new ArrayList<>();38 private final List<KeyPressReleaseListener> keyListeners = new ArrayList<>(); 39 private final List<ModifierListener> modifierListeners = new ArrayList<>(); 39 40 private int previousModifiers; 40 41 -
trunk/src/org/openstreetmap/josm/io/CacheFiles.java
r8308 r8338 10 10 import java.util.Iterator; 11 11 import java.util.Set; 12 import java.util.SortedMap; 12 13 import java.util.TreeMap; 13 14 … … 245 246 if(!this.enabled || maxsize == -1) return; 246 247 247 TreeMap<Long, File> modtime = new TreeMap<>();248 SortedMap<Long, File> modtime = new TreeMap<>(); 248 249 long dirsize = 0; 249 250 -
trunk/src/org/openstreetmap/josm/io/Capabilities.java
r8287 r8338 51 51 public class Capabilities { 52 52 53 private final Map<String, HashMap<String,String>> capabilities;53 private final Map<String, Map<String,String>> capabilities; 54 54 private final List<String> imageryBlacklist; 55 55 … … 71 71 public boolean isDefined(String element, String attribute) { 72 72 if (! capabilities.containsKey(element)) return false; 73 HashMap<String, String> e = capabilities.get(element);73 Map<String, String> e = capabilities.get(element); 74 74 if (e == null) return false; 75 75 return (e.get(attribute) != null); … … 85 85 public String get(String element, String attribute) { 86 86 if (! capabilities.containsKey(element)) return null; 87 HashMap<String, String> e = capabilities.get(element);87 Map<String, String> e = capabilities.get(element); 88 88 if (e == null) return null; 89 89 return e.get(attribute); … … 132 132 } else { 133 133 if (! capabilities.containsKey(element)) { 134 HashMap<String,String> h = new HashMap<>();134 Map<String,String> h = new HashMap<>(); 135 135 capabilities.put(element, h); 136 136 } 137 HashMap<String, String> e = capabilities.get(element);137 Map<String, String> e = capabilities.get(element); 138 138 e.put(attribute, value); 139 139 } -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r8291 r8338 239 239 */ 240 240 protected Set<Long> extractIdPackage(Set<Long> ids) { 241 HashSet<Long> pkg = new HashSet<>();241 Set<Long> pkg = new HashSet<>(); 242 242 if (ids.isEmpty()) 243 243 return pkg; -
trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
r7937 r8338 233 233 ImageryInfo i = new ImageryInfo(name, buildGetMapUrl(selectedLayers)); 234 234 if (selectedLayers != null) { 235 HashSet<String> proj = new HashSet<>();235 Set<String> proj = new HashSet<>(); 236 236 for (WMSImagery.LayerDetails l : selectedLayers) { 237 237 proj.addAll(l.getProjections()); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r8318 r8338 13 13 import java.util.List; 14 14 import java.util.Map; 15 import java.util.Set; 15 16 16 17 import javax.swing.JLabel; … … 228 229 } 229 230 } 230 HashSet<String> knownParams = new HashSet<>();231 Set<String> knownParams = new HashSet<>(); 231 232 if (mandatory != null) Collections.addAll(knownParams, mandatory); 232 233 if (optional != null) Collections.addAll(knownParams, optional); … … 316 317 @Override 317 318 protected void parseArgs() { 318 HashMap<String, String> args = new HashMap<>();319 Map<String, String> args = new HashMap<>(); 319 320 if (request.indexOf('?') != -1) { 320 321 String query = request.substring(request.indexOf('?') + 1); -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r8308 r8338 745 745 return null; 746 746 } 747 HashMap<String, PluginInformation> ret = new HashMap<>();747 Map<String, PluginInformation> ret = new HashMap<>(); 748 748 for (PluginInformation pi: task.getAvailablePlugins()) { 749 749 ret.put(pi.name, pi); … … 1319 1319 public static String getBugReportText() { 1320 1320 StringBuilder text = new StringBuilder(); 1321 Li nkedList <String> pl = new LinkedList<>(Main.pref.getCollection("plugins", new LinkedList<String>()));1321 List <String> pl = new LinkedList<>(Main.pref.getCollection("plugins", new LinkedList<String>())); 1322 1322 for (final PluginProxy pp : pluginList) { 1323 1323 PluginInformation pi = pp.getPluginInformation(); -
trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
r8290 r8338 27 27 import java.util.LinkedList; 28 28 import java.util.List; 29 import java.util.Set; 29 30 30 31 import javax.swing.JLabel; … … 276 277 protected List<PluginInformation> filterDeprecatedPlugins(List<PluginInformation> plugins) { 277 278 List<PluginInformation> ret = new ArrayList<>(plugins.size()); 278 HashSet<String> deprecatedPluginNames = new HashSet<>();279 Set<String> deprecatedPluginNames = new HashSet<>(); 279 280 for (PluginHandler.DeprecatedPlugin p : PluginHandler.DEPRECATED_PLUGINS) { 280 281 deprecatedPluginNames.add(p.name); -
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r8304 r8338 42 42 } 43 43 String[] args = url.substring(i+1).split("&"); 44 HashMap<String, String> map = new HashMap<>();44 Map<String, String> map = new HashMap<>(); 45 45 for (String arg : args) { 46 46 int eq = arg.indexOf('='); -
trunk/src/org/openstreetmap/josm/tools/Pair.java
r7509 r8338 2 2 package org.openstreetmap.josm.tools; 3 3 import java.util.ArrayList; 4 import java.util.List; 4 5 5 6 /** … … 31 32 } 32 33 33 @Override public int hashCode() { 34 @Override 35 public int hashCode() { 34 36 return a.hashCode() + b.hashCode(); 35 37 } 36 38 37 @Override public boolean equals(Object other) { 39 @Override 40 public boolean equals(Object other) { 38 41 if (other instanceof Pair<?, ?>) { 39 42 Pair<?, ?> o = (Pair<?, ?>)other; … … 43 46 } 44 47 45 public static <T> ArrayList<T> toArrayList(Pair<T, T> p) {46 ArrayList<T> l = new ArrayList<>(2);48 public static <T> List<T> toList(Pair<T, T> p) { 49 List<T> l = new ArrayList<>(2); 47 50 l.add(p.a); 48 51 l.add(p.b); -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r7606 r8338 310 310 Main.platform.initSystemShortcuts(); 311 311 // (2) User defined shortcuts 312 Li nkedList<Shortcut> newshortcuts = new LinkedList<>();312 List<Shortcut> newshortcuts = new LinkedList<>(); 313 313 for(String s : Main.pref.getAllPrefixCollectionKeys("shortcut.entry.")) { 314 314 newshortcuts.add(new Shortcut(s)); -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
r7937 r8338 183 183 public void testWriteGpxAndMarkerJoz() throws IOException { 184 184 GpxLayer gpx = createGpxLayer(); 185 testWrite(Pair.to ArrayList(new Pair<Layer, Layer>(gpx, createMarkerLayer(gpx))), true);185 testWrite(Pair.toList(new Pair<Layer, Layer>(gpx, createMarkerLayer(gpx))), true); 186 186 } 187 187 }
Note:
See TracChangeset
for help on using the changeset viewer.