Changeset 7005 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2014-04-26T17:39:23+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 63 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java
r6920 r7005 113 113 114 114 protected void launchInfoBrowsersForSelectedPrimitives() { 115 List<OsmPrimitive> primitivesToShow = new ArrayList< OsmPrimitive>(getCurrentDataSet().getAllSelected());115 List<OsmPrimitive> primitivesToShow = new ArrayList<>(getCurrentDataSet().getAllSelected()); 116 116 117 117 // filter out new primitives which are not yet uploaded to the server -
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r6934 r7005 131 131 132 132 Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected(); 133 List<Node> nodes = new LinkedList< Node>();133 List<Node> nodes = new LinkedList<>(); 134 134 // fixNodes: All nodes for which the angle relative to center should not be modified 135 HashSet<Node> fixNodes = new HashSet< Node>();136 List<Way> ways = new LinkedList< Way>();135 HashSet<Node> fixNodes = new HashSet<>(); 136 List<Way> ways = new LinkedList<>(); 137 137 EastNorth center = null; 138 138 double radius = 0; … … 156 156 Way closedWay = new Way(w); 157 157 closedWay.addNode(w.firstNode()); 158 ArrayList<Way> usedWays = new ArrayList< Way>(1);158 ArrayList<Way> usedWays = new ArrayList<>(1); 159 159 usedWays.add(closedWay); 160 160 nodes = collectNodesAnticlockwise(usedWays); 161 161 } else if (!ways.isEmpty() && checkWaysArePolygon(ways)) { 162 162 // Case 2 163 ArrayList<Node> inside = new ArrayList< Node>();164 ArrayList<Node> outside = new ArrayList< Node>();163 ArrayList<Node> inside = new ArrayList<>(); 164 ArrayList<Node> outside = new ArrayList<>(); 165 165 166 166 for(Node n: nodes) { … … 240 240 if(!actionAllowed(nodes)) return; 241 241 242 Collection<Command> cmds = new LinkedList< Command>();242 Collection<Command> cmds = new LinkedList<>(); 243 243 244 244 // Move each node to that distance from the center. … … 287 287 */ 288 288 private List<Node> collectNodesWithExternReferers(List<Way> ways) { 289 ArrayList<Node> withReferrers = new ArrayList< Node>();289 ArrayList<Node> withReferrers = new ArrayList<>(); 290 290 for(Way w: ways) 291 291 for(Node n: w.getNodes()) … … 301 301 */ 302 302 private List<Node> collectNodesAnticlockwise(List<Way> ways) { 303 ArrayList<Node> nodes = new ArrayList< Node>();303 ArrayList<Node> nodes = new ArrayList<>(); 304 304 Node firstNode = ways.get(0).firstNode(); 305 305 Node lastNode = null; -
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r6977 r7005 89 89 Collection<Way> ref = OsmPrimitive.getFilteredList(n.getReferrers(), Way.class); 90 90 if(waysRef == null) 91 waysRef = new HashSet< Way>(ref);91 waysRef = new HashSet<>(ref); 92 92 else 93 93 waysRef.retainAll(ref); … … 95 95 if(waysRef.size() == 1) { 96 96 // All nodes are part of the same way. See #9605 97 HashSet<Node> remainNodes = new HashSet< Node>(nodes);97 HashSet<Node> remainNodes = new HashSet<>(nodes); 98 98 Way way = waysRef.iterator().next(); 99 99 for(Node n: way.getNodes()) { … … 135 135 return; 136 136 137 List<Node> selectedNodes = new ArrayList< Node>(getCurrentDataSet().getSelectedNodes());138 List<Way> selectedWays = new ArrayList< Way>(getCurrentDataSet().getSelectedWays());137 List<Node> selectedNodes = new ArrayList<>(getCurrentDataSet().getSelectedNodes()); 138 List<Way> selectedWays = new ArrayList<>(getCurrentDataSet().getSelectedWays()); 139 139 140 140 try { … … 196 196 // use the nodes furthest apart as anchors 197 197 nodePairFurthestApart(nodes, anchors); 198 Collection<Command> cmds = new ArrayList< Command>(nodes.size());198 Collection<Command> cmds = new ArrayList<>(nodes.size()); 199 199 Line line = new Line(anchors[0], anchors[1]); 200 200 for(Node node: nodes) … … 212 212 private Command alignMultiWay(Collection<Way> ways) throws InvalidSelection { 213 213 // Collect all nodes and compute line equation 214 HashSet<Node> nodes = new HashSet< Node>();215 HashMap<Way, Line> lines = new HashMap< Way, Line>();214 HashSet<Node> nodes = new HashSet<>(); 215 HashMap<Way, Line> lines = new HashMap<>(); 216 216 for(Way w: ways) { 217 217 if(w.firstNode() == w.lastNode()) … … 220 220 lines.put(w, new Line(w)); 221 221 } 222 Collection<Command> cmds = new ArrayList< Command>(nodes.size());223 List<Way> referers = new ArrayList< Way>(ways.size());222 Collection<Command> cmds = new ArrayList<>(nodes.size()); 223 List<Way> referers = new ArrayList<>(ways.size()); 224 224 for(Node n: nodes) { 225 225 referers.clear(); … … 250 250 */ 251 251 private List<Line> getInvolvedLines(Node node, List<Way> refWays) throws InvalidSelection { 252 ArrayList<Line> lines = new ArrayList< Line>();253 ArrayList<Node> neighbors = new ArrayList< Node>();252 ArrayList<Line> lines = new ArrayList<>(); 253 ArrayList<Node> neighbors = new ArrayList<>(); 254 254 for(Way way: refWays) { 255 255 List<Node> nodes = way.getNodes(); -
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r6890 r7005 207 207 l.visitBoundingBox(v); 208 208 } else if (mode.equals("selection") || mode.equals("conflict")) { 209 Collection<OsmPrimitive> sel = new HashSet< OsmPrimitive>();209 Collection<OsmPrimitive> sel = new HashSet<>(); 210 210 if (mode.equals("selection")) { 211 211 sel = getCurrentDataSet().getSelected(); -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r6889 r7005 109 109 110 110 // remove duplicates, preserving order 111 ways = new LinkedHashSet< Way>(ways);111 ways = new LinkedHashSet<>(ways); 112 112 113 113 // try to build a new way which includes all the combined … … 125 125 TagCollection wayTags = TagCollection.unionOfAllPrimitives(ways); 126 126 127 List<Way> reversedWays = new LinkedList< Way>();128 List<Way> unreversedWays = new LinkedList< Way>();127 List<Way> reversedWays = new LinkedList<>(); 128 List<Way> unreversedWays = new LinkedList<>(); 129 129 for (Way w: ways) { 130 130 // Treat zero or one-node ways as unreversed as Combine action action is a good way to fix them (see #8971) … … 155 155 // if there are still reversed ways with direction-dependent tags, reverse their tags 156 156 if (!reversedWays.isEmpty() && PROP_REVERSE_WAY.get()) { 157 List<Way> unreversedTagWays = new ArrayList< Way>(ways);157 List<Way> unreversedTagWays = new ArrayList<>(ways); 158 158 unreversedTagWays.removeAll(reversedWays); 159 159 ReverseWayTagCorrector reverseWayTagCorrector = new ReverseWayTagCorrector(); 160 List<Way> reversedTagWays = new ArrayList< Way>(reversedWays.size());160 List<Way> reversedTagWays = new ArrayList<>(reversedWays.size()); 161 161 Collection<Command> changePropertyCommands = null; 162 162 for (Way w : reversedWays) { … … 183 183 List<Command> resolution = CombinePrimitiveResolverDialog.launchIfNecessary(wayTags, ways, Collections.singleton(targetWay)); 184 184 185 LinkedList<Command> cmds = new LinkedList< Command>();186 LinkedList<Way> deletedWays = new LinkedList< Way>(ways);185 LinkedList<Command> cmds = new LinkedList<>(); 186 LinkedList<Way> deletedWays = new LinkedList<>(ways); 187 187 deletedWays.remove(targetWay); 188 188 … … 377 377 public static class NodeGraph { 378 378 public static List<NodePair> buildNodePairs(Way way, boolean directed) { 379 List<NodePair> pairs = new ArrayList< NodePair>();379 List<NodePair> pairs = new ArrayList<>(); 380 380 for (Pair<Node,Node> pair: way.getNodePairs(false /* don't sort */)) { 381 381 pairs.add(new NodePair(pair)); … … 388 388 389 389 public static List<NodePair> buildNodePairs(List<Way> ways, boolean directed) { 390 List<NodePair> pairs = new ArrayList< NodePair>();390 List<NodePair> pairs = new ArrayList<>(); 391 391 for (Way w: ways) { 392 392 pairs.addAll(buildNodePairs(w, directed)); … … 396 396 397 397 public static List<NodePair> eliminateDuplicateNodePairs(List<NodePair> pairs) { 398 List<NodePair> cleaned = new ArrayList< NodePair>();398 List<NodePair> cleaned = new ArrayList<>(); 399 399 for(NodePair p: pairs) { 400 400 if (!cleaned.contains(p) && !cleaned.contains(p.swap())) { … … 449 449 } 450 450 } else { 451 List<NodePair> l = new ArrayList< NodePair>();451 List<NodePair> l = new ArrayList<>(); 452 452 l.add(pair); 453 453 successors.put(pair.getA(), l); … … 461 461 } 462 462 } else { 463 List<NodePair> l = new ArrayList< NodePair>();463 List<NodePair> l = new ArrayList<>(); 464 464 l.add(pair); 465 465 predecessors.put(pair.getB(), l); … … 480 480 481 481 protected void prepare() { 482 Set<NodePair> undirectedEdges = new LinkedHashSet< NodePair>();483 successors = new LinkedHashMap< Node, List<NodePair>>();484 predecessors = new LinkedHashMap< Node, List<NodePair>>();482 Set<NodePair> undirectedEdges = new LinkedHashSet<>(); 483 successors = new LinkedHashMap<>(); 484 predecessors = new LinkedHashMap<>(); 485 485 486 486 for (NodePair pair: edges) { … … 498 498 */ 499 499 public NodeGraph() { 500 edges = new LinkedHashSet< NodePair>();500 edges = new LinkedHashSet<>(); 501 501 } 502 502 … … 523 523 524 524 protected Set<Node> getTerminalNodes() { 525 Set<Node> ret = new LinkedHashSet< Node>();525 Set<Node> ret = new LinkedHashSet<>(); 526 526 for (Node n: getNodes()) { 527 527 if (isTerminalNode(n)) { … … 533 533 534 534 protected Set<Node> getNodes(Stack<NodePair> pairs) { 535 HashSet<Node> nodes = new LinkedHashSet< Node>(2*pairs.size());535 HashSet<Node> nodes = new LinkedHashSet<>(2*pairs.size()); 536 536 for (NodePair pair: pairs) { 537 537 nodes.add(pair.getA()); … … 553 553 554 554 protected Set<Node> getNodes() { 555 Set<Node> nodes = new LinkedHashSet< Node>(2 * edges.size());555 Set<Node> nodes = new LinkedHashSet<>(2 * edges.size()); 556 556 for (NodePair pair: edges) { 557 557 nodes.add(pair.getA()); … … 566 566 567 567 protected List<Node> buildPathFromNodePairs(Stack<NodePair> path) { 568 LinkedList<Node> ret = new LinkedList< Node>();568 LinkedList<Node> ret = new LinkedList<>(); 569 569 for (NodePair pair: path) { 570 570 ret.add(pair.getA()); … … 585 585 if (startNode == null) 586 586 return null; 587 Stack<NodePair> path = new Stack< NodePair>();588 Stack<NodePair> nextPairs = new Stack< NodePair>();587 Stack<NodePair> path = new Stack<>(); 588 Stack<NodePair> nextPairs = new Stack<>(); 589 589 nextPairs.addAll(getOutboundPairs(startNode)); 590 590 while(!nextPairs.isEmpty()) { -
trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java
r6977 r7005 137 137 138 138 Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected(); 139 List<Node> nodes = new LinkedList< Node>();139 List<Node> nodes = new LinkedList<>(); 140 140 Way existingWay = null; 141 141 … … 170 170 171 171 // now we can start doing things to OSM data 172 Collection<Command> cmds = new LinkedList< Command>();172 Collection<Command> cmds = new LinkedList<>(); 173 173 EastNorth center = null; 174 174 … … 210 210 211 211 // build a way for the circle 212 List<Node> wayToAdd = new ArrayList< Node>();212 List<Node> wayToAdd = new ArrayList<>(); 213 213 for(int i = 0; i < nodes.size(); i++) { 214 214 wayToAdd.add(angles[i].node); -
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r6913 r7005 174 174 return selectedRelations.iterator().next(); 175 175 } else { 176 final HashSet<Relation> relatedRelations = new HashSet< Relation>();176 final HashSet<Relation> relatedRelations = new HashSet<>(); 177 177 for (final Way w : selectedWays) { 178 178 relatedRelations.addAll(Utils.filteredCollection(w.getReferrers(), Relation.class)); … … 188 188 189 189 // add ways of existing relation to include them in polygon analysis 190 Set<Way> ways = new HashSet< Way>(selectedWays);190 Set<Way> ways = new HashSet<>(selectedWays); 191 191 ways.addAll(selectedMultipolygonRelation.getMemberPrimitives(Way.class)); 192 192 … … 303 303 private static void addMembers(JoinedPolygon polygon, Relation rel, String role) { 304 304 final int count = rel.getMembersCount(); 305 final HashSet<Way> ways = new HashSet< Way>(polygon.ways);305 final HashSet<Way> ways = new HashSet<>(polygon.ways); 306 306 for (int i = 0; i < count; i++) { 307 307 final RelationMember m = rel.getMember(i); … … 325 325 */ 326 326 public static List<Command> removeTagsFromWaysIfNeeded( Relation relation ) { 327 Map<String, String> values = new HashMap< String, String>(relation.getKeys());328 329 List<Way> innerWays = new ArrayList< Way>();330 List<Way> outerWays = new ArrayList< Way>();331 332 Set<String> conflictingKeys = new TreeSet< String>();327 Map<String, String> values = new HashMap<>(relation.getKeys()); 328 329 List<Way> innerWays = new ArrayList<>(); 330 List<Way> outerWays = new ArrayList<>(); 331 332 Set<String> conflictingKeys = new TreeSet<>(); 333 333 334 334 for( RelationMember m : relation.getMembers() ) { … … 371 371 values.put("area", "yes"); 372 372 373 List<Command> commands = new ArrayList< Command>();373 List<Command> commands = new ArrayList<>(); 374 374 boolean moveTags = Main.pref.getBoolean("multipoly.movetags", true); 375 375 376 376 for (Entry<String, String> entry : values.entrySet()) { 377 List<OsmPrimitive> affectedWays = new ArrayList< OsmPrimitive>();377 List<OsmPrimitive> affectedWays = new ArrayList<>(); 378 378 String key = entry.getKey(); 379 379 String value = entry.getValue(); -
trunk/src/org/openstreetmap/josm/actions/DistributeAction.java
r6380 r7005 52 52 return; 53 53 Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected(); 54 Collection<Node> nodes = new LinkedList< Node>();55 Collection<Node> itnodes = new LinkedList< Node>();54 Collection<Node> nodes = new LinkedList<>(); 55 Collection<Node> itnodes = new LinkedList<>(); 56 56 for (OsmPrimitive osm : sel) 57 57 if (osm instanceof Node) { … … 115 115 116 116 // A list of commands to do 117 Collection<Command> cmds = new LinkedList< Command>();117 Collection<Command> cmds = new LinkedList<>(); 118 118 119 119 // Amount of nodes between A and B plus 1 … … 152 152 153 153 private Set<Node> removeNodesWithoutCoordinates(Collection<Node> col) { 154 Set<Node> result = new HashSet< Node>();154 Set<Node> result = new HashSet<>(); 155 155 for (Iterator<Node> it = col.iterator(); it.hasNext();) { 156 156 Node n = it.next(); -
trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
r6987 r7005 93 93 */ 94 94 protected static void confirmAndDownloadAreas(Area a, double maxArea, boolean osmDownload, boolean gpxDownload, String title, ProgressMonitor progressMonitor) { 95 List<Rectangle2D> toDownload = new ArrayList< Rectangle2D>();95 List<Rectangle2D> toDownload = new ArrayList<>(); 96 96 addToDownload(a, a.getBounds(), toDownload, maxArea); 97 97 if (toDownload.isEmpty()) { -
trunk/src/org/openstreetmap/josm/actions/ExpertToggleAction.java
r6890 r7005 23 23 } 24 24 25 private static final List<WeakReference<ExpertModeChangeListener>> listeners = new ArrayList< WeakReference<ExpertModeChangeListener>>();26 private static final List<WeakReference<Component>> visibilityToggleListeners = new ArrayList< WeakReference<Component>>();25 private static final List<WeakReference<ExpertModeChangeListener>> listeners = new ArrayList<>(); 26 private static final List<WeakReference<Component>> visibilityToggleListeners = new ArrayList<>(); 27 27 28 28 private static final ExpertToggleAction INSTANCE = new ExpertToggleAction(); … … 70 70 if (wr.get() == listener) return; 71 71 } 72 listeners.add(new WeakReference< ExpertModeChangeListener>(listener));72 listeners.add(new WeakReference<>(listener)); 73 73 if (fireWhenAdding) { 74 74 listener.expertChanged(isExpert()); … … 100 100 if (wr.get() == c) return; 101 101 } 102 visibilityToggleListeners.add(new WeakReference< Component>(c));102 visibilityToggleListeners.add(new WeakReference<>(c)); 103 103 c.setVisible(isExpert()); 104 104 } -
trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
r6889 r7005 43 43 static { 44 44 45 importers = new ArrayList< FileImporter>();45 importers = new ArrayList<>(); 46 46 47 47 String[] importerNames = { … … 69 69 } 70 70 71 exporters = new ArrayList< FileExporter>();71 exporters = new ArrayList<>(); 72 72 73 73 String[] exporterNames = { … … 138 138 public static List<ExtensionFileFilter> getImportExtensionFileFilters() { 139 139 updateAllFormatsImporter(); 140 LinkedList<ExtensionFileFilter> filters = new LinkedList< ExtensionFileFilter>();140 LinkedList<ExtensionFileFilter> filters = new LinkedList<>(); 141 141 for (FileImporter importer : importers) { 142 142 filters.add(importer.filter); … … 155 155 */ 156 156 public static List<ExtensionFileFilter> getExportExtensionFileFilters() { 157 LinkedList<ExtensionFileFilter> filters = new LinkedList< ExtensionFileFilter>();157 LinkedList<ExtensionFileFilter> filters = new LinkedList<>(); 158 158 for (FileExporter exporter : exporters) { 159 159 if (filters.contains(exporter.filter) || !exporter.isEnabled()) { -
trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java
r6327 r7005 70 70 JFrame frame = (JFrame) Main.parent; 71 71 72 List<Window> visibleWindows = new ArrayList< Window>();72 List<Window> visibleWindows = new ArrayList<>(); 73 73 visibleWindows.add(frame); 74 74 for (Window w : Frame.getWindows()) { -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r6987 r7005 52 52 public class JoinAreasAction extends JosmAction { 53 53 // This will be used to commit commands and unite them into one large command sequence at the end 54 private final LinkedList<Command> cmds = new LinkedList< Command>();54 private final LinkedList<Command> cmds = new LinkedList<>(); 55 55 private int cmdsCount = 0; 56 private final List<Relation> addedRelations = new LinkedList< Relation>();56 private final List<Relation> addedRelations = new LinkedList<>(); 57 57 58 58 /** … … 74 74 public Multipolygon(Way way) { 75 75 outerWay = way; 76 innerWays = new ArrayList< Way>();76 innerWays = new ArrayList<>(); 77 77 } 78 78 } … … 143 143 144 144 public List<Node> getNodes() { 145 List<Node> nodes = new ArrayList< Node>();145 List<Node> nodes = new ArrayList<>(); 146 146 for (WayInPolygon way : this.ways) { 147 147 //do not add the last node as it will be repeated in the next way … … 177 177 public AssembledMultipolygon(AssembledPolygon way) { 178 178 outerWay = way; 179 innerWays = new ArrayList< AssembledPolygon>();179 innerWays = new ArrayList<>(); 180 180 } 181 181 } … … 195 195 public WayTraverser(Collection<WayInPolygon> ways) { 196 196 197 availableWays = new HashSet< WayInPolygon>(ways);197 availableWays = new HashSet<>(ways); 198 198 lastWay = null; 199 199 } … … 310 310 @Override 311 311 public void actionPerformed(ActionEvent e) { 312 LinkedList<Way> ways = new LinkedList< Way>(Main.main.getCurrentDataSet().getSelectedWays());312 LinkedList<Way> ways = new LinkedList<>(Main.main.getCurrentDataSet().getSelectedWays()); 313 313 addedRelations.clear(); 314 314 … … 321 321 } 322 322 323 List<Node> allNodes = new ArrayList< Node>();323 List<Node> allNodes = new ArrayList<>(); 324 324 for (Way way : ways) { 325 325 if (!way.isClosed()) { … … 376 376 commitCommands(tr("Move tags from ways to relations")); 377 377 378 List<Way> allWays = new ArrayList< Way>();378 List<Way> allWays = new ArrayList<>(); 379 379 for (Multipolygon pol : result.polygons) { 380 380 allWays.add(pol.outerWay); … … 406 406 */ 407 407 private boolean testJoin(List<Multipolygon> areas) { 408 List<Way> allStartingWays = new ArrayList< Way>();408 List<Way> allStartingWays = new ArrayList<>(); 409 409 410 410 for (Multipolygon area : areas) { … … 428 428 result.hasChanges = false; 429 429 430 List<Way> allStartingWays = new ArrayList< Way>();431 List<Way> innerStartingWays = new ArrayList< Way>();432 List<Way> outerStartingWays = new ArrayList< Way>();430 List<Way> allStartingWays = new ArrayList<>(); 431 List<Way> innerStartingWays = new ArrayList<>(); 432 List<Way> outerStartingWays = new ArrayList<>(); 433 433 434 434 for (Multipolygon area : areas) { … … 457 457 commitCommands(marktr("Added node on all intersections")); 458 458 459 List<RelationRole> relations = new ArrayList< RelationRole>();459 List<RelationRole> relations = new ArrayList<>(); 460 460 461 461 // Remove ways from all relations so ways can be combined/split quietly … … 467 467 boolean warnAboutRelations = !relations.isEmpty() && allStartingWays.size() > 1; 468 468 469 List<WayInPolygon> preparedWays = new ArrayList< WayInPolygon>();469 List<WayInPolygon> preparedWays = new ArrayList<>(); 470 470 471 471 for (Way way : outerStartingWays) { … … 480 480 481 481 // Find boundary ways 482 List<Way> discardedWays = new ArrayList< Way>();482 List<Way> discardedWays = new ArrayList<>(); 483 483 List<AssembledPolygon> bounadries = findBoundaryPolygons(preparedWays, discardedWays); 484 484 … … 488 488 489 489 //assemble final polygons 490 List<Multipolygon> polygons = new ArrayList< Multipolygon>();491 Set<Relation> relationsToDelete = new LinkedHashSet< Relation>();490 List<Multipolygon> polygons = new ArrayList<>(); 491 Set<Relation> relationsToDelete = new LinkedHashSet<>(); 492 492 493 493 for (AssembledMultipolygon pol : preparedPolygons) { … … 548 548 private boolean resolveTagConflicts(List<Multipolygon> polygons) { 549 549 550 List<Way> ways = new ArrayList< Way>();550 List<Way> ways = new ArrayList<>(); 551 551 552 552 for (Multipolygon pol : polygons) { … … 577 577 //TODO: maybe join nodes with JoinNodesAction, rather than reconnect the ways. 578 578 579 Map<Node, Node> nodeMap = new TreeMap< Node, Node>(new NodePositionComparator());579 Map<Node, Node> nodeMap = new TreeMap<>(new NodePositionComparator()); 580 580 int totalNodesRemoved = 0; 581 581 … … 586 586 587 587 int nodesRemoved = 0; 588 List<Node> newNodes = new ArrayList< Node>();588 List<Node> newNodes = new ArrayList<>(); 589 589 Node prevNode = null; 590 590 … … 661 661 private List<WayInPolygon> markWayInsideSide(List<Way> parts, boolean isInner) { 662 662 663 List<WayInPolygon> result = new ArrayList< WayInPolygon>();663 List<WayInPolygon> result = new ArrayList<>(); 664 664 665 665 //prepare prev and next maps 666 Map<Way, Way> nextWayMap = new HashMap< Way, Way>();667 Map<Way, Way> prevWayMap = new HashMap< Way, Way>();666 Map<Way, Way> nextWayMap = new HashMap<>(); 667 Map<Way, Way> prevWayMap = new HashMap<>(); 668 668 669 669 for (int pos = 0; pos < parts.size(); pos ++) { … … 831 831 private List<Way> splitWayOnNodes(Way way, Set<Node> nodes) { 832 832 833 List<Way> result = new ArrayList< Way>();833 List<Way> result = new ArrayList<>(); 834 834 List<List<Node>> chunks = buildNodeChunks(way, nodes); 835 835 … … 859 859 */ 860 860 private List<List<Node>> buildNodeChunks(Way way, Collection<Node> splitNodes) { 861 List<List<Node>> result = new ArrayList< List<Node>>();862 List<Node> curList = new ArrayList< Node>();861 List<List<Node>> result = new ArrayList<>(); 862 List<Node> curList = new ArrayList<>(); 863 863 864 864 for (Node node : way.getNodes()) { … … 866 866 if (curList.size() > 1 && splitNodes.contains(node)) { 867 867 result.add(curList); 868 curList = new ArrayList< Node>();868 curList = new ArrayList<>(); 869 869 curList.add(node); 870 870 } … … 877 877 return result; 878 878 } 879 880 879 881 880 /** … … 887 886 888 887 List<PolygonLevel> list = findOuterWaysImpl(0, boundaries); 889 List<AssembledMultipolygon> result = new ArrayList< AssembledMultipolygon>();888 List<AssembledMultipolygon> result = new ArrayList<>(); 890 889 891 890 //take every other level … … 908 907 909 908 //TODO: bad performance for deep nestings... 910 List<PolygonLevel> result = new ArrayList< PolygonLevel>();909 List<PolygonLevel> result = new ArrayList<>(); 911 910 912 911 for (AssembledPolygon outerWay : boundaryWays) { 913 912 914 913 boolean outerGood = true; 915 List<AssembledPolygon> innerCandidates = new ArrayList< AssembledPolygon>();914 List<AssembledPolygon> innerCandidates = new ArrayList<>(); 916 915 917 916 for (AssembledPolygon innerWay : boundaryWays) { … … 963 962 //first find all discardable ways, by getting outer shells. 964 963 //this will produce incorrect boundaries in some cases, but second pass will fix it. 965 List<WayInPolygon> discardedWays = new ArrayList< WayInPolygon>();964 List<WayInPolygon> discardedWays = new ArrayList<>(); 966 965 967 966 // In multigonWays collection, some way are just a point (i.e. way like nodeA-nodeA) 968 967 // This seems to appear when is apply over invalid way like #9911 test-case 969 968 // Remove all of these way to make the next work. 970 ArrayList<WayInPolygon> cleanMultigonWays = new ArrayList< WayInPolygon>();969 ArrayList<WayInPolygon> cleanMultigonWays = new ArrayList<>(); 971 970 for(WayInPolygon way: multigonWays) 972 971 if(way.way.getNodesCount() == 2 && way.way.firstNode() == way.way.lastNode()) … … 976 975 977 976 WayTraverser traverser = new WayTraverser(cleanMultigonWays); 978 List<AssembledPolygon> result = new ArrayList< AssembledPolygon>();977 List<AssembledPolygon> result = new ArrayList<>(); 979 978 980 979 WayInPolygon startWay; 981 980 while((startWay = traverser.startNewWay()) != null) { 982 ArrayList<WayInPolygon> path = new ArrayList< WayInPolygon>();981 ArrayList<WayInPolygon> path = new ArrayList<>(); 983 982 path.add(startWay); 984 983 while(true) { … … 1024 1023 */ 1025 1024 public static List<AssembledPolygon> fixTouchingPolygons(List<AssembledPolygon> polygons) { 1026 List<AssembledPolygon> newPolygons = new ArrayList< AssembledPolygon>();1025 List<AssembledPolygon> newPolygons = new ArrayList<>(); 1027 1026 1028 1027 for (AssembledPolygon ring : polygons) { … … 1032 1031 1033 1032 while((startWay = traverser.startNewWay()) != null) { 1034 List<WayInPolygon> simpleRingWays = new ArrayList< WayInPolygon>();1033 List<WayInPolygon> simpleRingWays = new ArrayList<>(); 1035 1034 simpleRingWays.add(startWay); 1036 1035 WayInPolygon nextWay; … … 1057 1056 */ 1058 1057 public static boolean wayInsideWay(AssembledPolygon inside, AssembledPolygon outside) { 1059 Set<Node> outsideNodes = new HashSet< Node>(outside.getNodes());1058 Set<Node> outsideNodes = new HashSet<>(outside.getNodes()); 1060 1059 List<Node> insideNodes = inside.getNodes(); 1061 1060 … … 1127 1126 1128 1127 //TODO: ReverseWay and Combine way are really slow and we use them a lot here. This slows down large joins. 1129 List<Way> actionWays = new ArrayList< Way>(ways.size());1128 List<Way> actionWays = new ArrayList<>(ways.size()); 1130 1129 1131 1130 for (WayInPolygon way : ways) { … … 1154 1153 private List<Multipolygon> collectMultipolygons(List<Way> selectedWays) { 1155 1154 1156 List<Multipolygon> result = new ArrayList< Multipolygon>();1155 List<Multipolygon> result = new ArrayList<>(); 1157 1156 1158 1157 //prepare the lists, to minimize memory allocation. 1159 List<Way> outerWays = new ArrayList< Way>();1160 List<Way> innerWays = new ArrayList< Way>();1161 1162 Set<Way> processedOuterWays = new LinkedHashSet< Way>();1163 Set<Way> processedInnerWays = new LinkedHashSet< Way>();1158 List<Way> outerWays = new ArrayList<>(); 1159 List<Way> innerWays = new ArrayList<>(); 1160 1161 Set<Way> processedOuterWays = new LinkedHashSet<>(); 1162 Set<Way> processedInnerWays = new LinkedHashSet<>(); 1164 1163 1165 1164 for (Relation r : OsmPrimitive.getParentRelations(selectedWays)) { … … 1283 1282 */ 1284 1283 private List<RelationRole> removeFromAllRelations(OsmPrimitive osm) { 1285 List<RelationRole> result = new ArrayList< RelationRole>();1284 List<RelationRole> result = new ArrayList<>(); 1286 1285 1287 1286 for (Relation r : Main.main.getCurrentDataSet().getRelations()) { … … 1322 1321 */ 1323 1322 private void fixRelations(List<RelationRole> rels, Way outer, RelationRole ownMultipol, Set<Relation> relationsToDelete) { 1324 List<RelationRole> multiouters = new ArrayList< RelationRole>();1323 List<RelationRole> multiouters = new ArrayList<>(); 1325 1324 1326 1325 if (ownMultipol != null) { -
trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
r6814 r7005 47 47 Node node = selectedNodes.iterator().next(); 48 48 49 Collection<Command> cmds = new LinkedList< Command>();49 Collection<Command> cmds = new LinkedList<>(); 50 50 51 51 // If the user has selected some ways, only join the node to these. … … 55 55 List<WaySegment> wss = Main.map.mapView.getNearestWaySegments( 56 56 Main.map.mapView.getPoint(node), OsmPrimitive.isSelectablePredicate); 57 HashMap<Way, List<Integer>> insertPoints = new HashMap< Way, List<Integer>>();57 HashMap<Way, List<Integer>> insertPoints = new HashMap<>(); 58 58 for (WaySegment ws : wss) { 59 59 // Maybe cleaner to pass a "isSelected" predicate to getNearestWaySegments, but this is less invasive. … … 66 66 is = insertPoints.get(ws.way); 67 67 } else { 68 is = new ArrayList< Integer>();68 is = new ArrayList<>(); 69 69 insertPoints.put(ws.way, is); 70 70 } … … 98 98 99 99 private static void pruneSuccsAndReverse(List<Integer> is) { 100 HashSet<Integer> is2 = new HashSet< Integer>();100 HashSet<Integer> is2 = new HashSet<>(); 101 101 for (int i : is) { 102 102 if (!is2.contains(i - 1) && !is2.contains(i + 1)) { -
trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java
r6340 r7005 64 64 * List of available rectifier services. May be extended from the outside 65 65 */ 66 public List<RectifierService> services = new ArrayList< RectifierService>();66 public List<RectifierService> services = new ArrayList<>(); 67 67 68 68 public MapRectifierWMSmenuAction() { -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r6679 r7005 195 195 */ 196 196 protected static List<Command> fixParentWays(Collection<Node> nodesToDelete, Node targetNode) { 197 List<Command> cmds = new ArrayList< Command>();198 Set<Way> waysToDelete = new HashSet< Way>();197 List<Command> cmds = new ArrayList<>(); 198 Set<Way> waysToDelete = new HashSet<>(); 199 199 200 200 for (Way w: OsmPrimitive.getFilteredList(OsmPrimitive.getReferrer(nodesToDelete), Way.class)) { 201 List<Node> newNodes = new ArrayList< Node>(w.getNodesCount());201 List<Node> newNodes = new ArrayList<>(w.getNodesCount()); 202 202 for (Node n: w.getNodes()) { 203 203 if (! nodesToDelete.contains(n) && n != targetNode) { … … 264 264 return; 265 265 } 266 Set<Node> allNodes = new HashSet< Node>(nodes);266 Set<Node> allNodes = new HashSet<>(nodes); 267 267 allNodes.add(targetLocationNode); 268 268 Node target; … … 294 294 return null; 295 295 } 296 Set<Node> allNodes = new HashSet< Node>(nodes);296 Set<Node> allNodes = new HashSet<>(nodes); 297 297 allNodes.add(targetLocationNode); 298 298 return mergeNodes(layer, nodes, selectTargetNode(allNodes), targetLocationNode); … … 320 320 TagCollection nodeTags = TagCollection.unionOfAllPrimitives(nodes); 321 321 List<Command> resultion = CombinePrimitiveResolverDialog.launchIfNecessary(nodeTags, nodes, Collections.singleton(targetNode)); 322 LinkedList<Command> cmds = new LinkedList< Command>();322 LinkedList<Command> cmds = new LinkedList<>(); 323 323 324 324 // the nodes we will have to delete 325 325 // 326 Collection<Node> nodesToDelete = new HashSet< Node>(nodes);326 Collection<Node> nodesToDelete = new HashSet<>(nodes); 327 327 nodesToDelete.remove(targetNode); 328 328 329 329 // fix the ways referring to at least one of the merged nodes 330 330 // 331 Collection<Way> waysToDelete = new HashSet< Way>();331 Collection<Way> waysToDelete = new HashSet<>(); 332 332 List<Command> wayFixCommands = fixParentWays( 333 333 nodesToDelete, -
trunk/src/org/openstreetmap/josm/actions/MirrorAction.java
r6830 r7005 45 45 public void actionPerformed(ActionEvent e) { 46 46 Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected(); 47 HashSet<Node> nodes = new HashSet< Node>();47 HashSet<Node> nodes = new HashSet<>(); 48 48 49 49 for (OsmPrimitive osm : sel) { … … 73 73 double middle = (minEast + maxEast) / 2; 74 74 75 Collection<Command> cmds = new LinkedList< Command>();75 Collection<Command> cmds = new LinkedList<>(); 76 76 77 77 for (Node n : nodes) { -
trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
r6995 r7005 96 96 public static class OpenFileTask extends PleaseWaitRunnable { 97 97 private List<File> files; 98 private List<File> successfullyOpenedFiles = new ArrayList< File>();98 private List<File> successfullyOpenedFiles = new ArrayList<>(); 99 99 private FileFilter fileFilter; 100 100 private boolean canceled; … … 103 103 public OpenFileTask(List<File> files, FileFilter fileFilter, String title) { 104 104 super(title, false /* don't ignore exception */); 105 this.files = new ArrayList< File>(files);105 this.files = new ArrayList<>(files); 106 106 this.fileFilter = fileFilter; 107 107 } … … 214 214 if (chosenImporter != null) { 215 215 // The importer was explicitly chosen, so use it. 216 List<File> filesNotMatchingWithImporter = new LinkedList< File>();217 List<File> filesMatchingWithImporter = new LinkedList< File>();216 List<File> filesNotMatchingWithImporter = new LinkedList<>(); 217 List<File> filesMatchingWithImporter = new LinkedList<>(); 218 218 for (final File f : files) { 219 219 if (!chosenImporter.acceptFile(f)) { … … 247 247 } else { 248 248 // find appropriate importer 249 MultiMap<FileImporter, File> importerMap = new MultiMap< FileImporter, File>();250 List<File> filesWithUnknownImporter = new LinkedList< File>();251 List<File> urlFiles = new LinkedList< File>();249 MultiMap<FileImporter, File> importerMap = new MultiMap<>(); 250 List<File> filesWithUnknownImporter = new LinkedList<>(); 251 List<File> urlFiles = new LinkedList<>(); 252 252 FILES: for (File f : files) { 253 253 for (FileImporter importer : ExtensionFileFilter.importers) { … … 266 266 alertFilesWithUnknownImporter(filesWithUnknownImporter); 267 267 } 268 List<FileImporter> importers = new ArrayList< FileImporter>(importerMap.keySet());268 List<FileImporter> importers = new ArrayList<>(importerMap.keySet()); 269 269 Collections.sort(importers); 270 270 Collections.reverse(importers); 271 271 272 Set<String> fileHistory = new LinkedHashSet< String>();273 Set<String> failedAll = new HashSet< String>();272 Set<String> fileHistory = new LinkedHashSet<>(); 273 Set<String> failedAll = new HashSet<>(); 274 274 275 275 for (FileImporter importer : importers) { 276 List<File> files = new ArrayList< File>(importerMap.get(importer));276 List<File> files = new ArrayList<>(importerMap.get(importer)); 277 277 importData(importer, files); 278 278 // suppose all files will fail to load 279 List<File> failedFiles = new ArrayList< File>(files);279 List<File> failedFiles = new ArrayList<>(files); 280 280 281 281 if (recordHistory && !importer.isBatchImporter()) { -
trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
r6890 r7005 56 56 Shortcut.registerShortcut("system:open_location", tr("File: {0}", tr("Open Location...")), KeyEvent.VK_L, Shortcut.CTRL), true); 57 57 putValue("help", ht("/Action/OpenLocation")); 58 this.downloadTasks = new ArrayList< Class<? extends DownloadTask>>();58 this.downloadTasks = new ArrayList<>(); 59 59 addDownloadTaskClass(DownloadOsmTask.class); 60 60 addDownloadTaskClass(DownloadGpsTask.class); … … 72 72 */ 73 73 protected void restoreUploadAddressHistory(HistoryComboBox cbHistory) { 74 List<String> cmtHistory = new LinkedList< String>(Main.pref.getCollection(getClass().getName() + ".uploadAddressHistory", new LinkedList<String>()));74 List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(getClass().getName() + ".uploadAddressHistory", new LinkedList<String>())); 75 75 // we have to reverse the history, because ComboBoxHistory will reverse it again 76 76 // in addElement() … … 134 134 */ 135 135 public Collection<DownloadTask> findDownloadTasks(final String url) { 136 List<DownloadTask> result = new ArrayList< DownloadTask>();136 List<DownloadTask> result = new ArrayList<>(); 137 137 for (Class<? extends DownloadTask> taskClass : downloadTasks) { 138 138 if (taskClass != null) { -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r6987 r7005 72 72 * Remember movements, so the user can later undo it for certain nodes 73 73 */ 74 private static final Map<Node, EastNorth> rememberMovements = new HashMap< Node, EastNorth>();74 private static final Map<Node, EastNorth> rememberMovements = new HashMap<>(); 75 75 76 76 /** … … 98 98 if (!isEnabled()) 99 99 return; 100 final Collection<Command> commands = new LinkedList< Command>();100 final Collection<Command> commands = new LinkedList<>(); 101 101 final Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected(); 102 102 try { … … 145 145 } 146 146 147 final List<Node> nodeList = new ArrayList< Node>();148 final List<WayData> wayDataList = new ArrayList< WayData>();147 final List<Node> nodeList = new ArrayList<>(); 148 final List<WayData> wayDataList = new ArrayList<>(); 149 149 final Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected(); 150 150 … … 165 165 if (nodeList.size() == 2 || nodeList.isEmpty()) { 166 166 OrthogonalizeAction.rememberMovements.clear(); 167 final Collection<Command> commands = new LinkedList< Command>();167 final Collection<Command> commands = new LinkedList<>(); 168 168 169 169 if (nodeList.size() == 2) { // fixed direction … … 202 202 */ 203 203 private static List<List<WayData>> buildGroups(List<WayData> wayDataList) { 204 List<List<WayData>> groups = new ArrayList< List<WayData>>();205 Set<WayData> remaining = new HashSet< WayData>(wayDataList);204 List<List<WayData>> groups = new ArrayList<>(); 205 Set<WayData> remaining = new HashSet<>(wayDataList); 206 206 while (!remaining.isEmpty()) { 207 List<WayData> group = new ArrayList< WayData>();207 List<WayData> group = new ArrayList<>(); 208 208 groups.add(group); 209 209 Iterator<WayData> it = remaining.iterator(); 210 210 WayData next = it.next(); 211 211 it.remove(); 212 extendGroupRec(group, next, new ArrayList< WayData>(remaining));212 extendGroupRec(group, next, new ArrayList<>(remaining)); 213 213 remaining.removeAll(group); 214 214 } … … 283 283 284 284 // put the nodes of all ways in a set 285 final HashSet<Node> allNodes = new HashSet< Node>();285 final HashSet<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< Node, Double>();294 final HashMap<Node, Double> nY = new HashMap< Node, Double>();293 final HashMap<Node, Double> nX = new HashMap<>(); 294 final HashMap<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< Node>(allNodes);316 final HashSet<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< Node>(); // will contain each node that can be reached from dummy_n324 final HashSet<Node> cs = new HashSet<>(); // will contain each node that can be reached from dummy_n 325 325 cs.add(dummy_n); // walking only on horizontal / vertical segments 326 326 … … 381 381 382 382 // rotate back and log the change 383 final Collection<Command> commands = new LinkedList< Command>();383 final Collection<Command> commands = new LinkedList<>(); 384 384 for (Node n: allNodes) { 385 385 EastNorth tmp = new EastNorth(nX.get(n), nY.get(n)); -
trunk/src/org/openstreetmap/josm/actions/ParameterizedActionDecorator.java
r6084 r7005 16 16 public ParameterizedActionDecorator(ParameterizedAction action, Map<String, Object> parameters) { 17 17 this.action = action; 18 this.parameters = new HashMap< String, Object>(parameters);18 this.parameters = new HashMap<>(parameters); 19 19 } 20 20 -
trunk/src/org/openstreetmap/josm/actions/PasteAction.java
r6920 r7005 106 106 107 107 // Make a copy of pasteBuffer and map from old id to copied data id 108 List<PrimitiveData> bufferCopy = new ArrayList< PrimitiveData>();109 List<PrimitiveData> toSelect = new ArrayList< PrimitiveData>();110 Map<Long, Long> newNodeIds = new HashMap< Long, Long>();111 Map<Long, Long> newWayIds = new HashMap< Long, Long>();112 Map<Long, Long> newRelationIds = new HashMap< Long, Long>();108 List<PrimitiveData> bufferCopy = new ArrayList<>(); 109 List<PrimitiveData> toSelect = new ArrayList<>(); 110 Map<Long, Long> newNodeIds = new HashMap<>(); 111 Map<Long, Long> newWayIds = new HashMap<>(); 112 Map<Long, Long> newRelationIds = new HashMap<>(); 113 113 for (PrimitiveData data: pasteBuffer.getAll()) { 114 114 if (data.isIncomplete()) { … … 138 138 } 139 139 } else if (data instanceof WayData) { 140 List<Long> newNodes = new ArrayList< Long>();140 List<Long> newNodes = new ArrayList<>(); 141 141 for (Long oldNodeId: ((WayData)data).getNodes()) { 142 142 Long newNodeId = newNodeIds.get(oldNodeId); … … 147 147 ((WayData)data).setNodes(newNodes); 148 148 } else if (data instanceof RelationData) { 149 List<RelationMemberData> newMembers = new ArrayList< RelationMemberData>();149 List<RelationMemberData> newMembers = new ArrayList<>(); 150 150 for (RelationMemberData member: ((RelationData)data).getMembers()) { 151 151 OsmPrimitiveType memberType = member.getMemberType(); -
trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
r6380 r7005 56 56 private final Collection<PrimitiveData> source; 57 57 private final Collection<OsmPrimitive> target; 58 private final List<Tag> commands = new ArrayList< Tag>();58 private final List<Tag> commands = new ArrayList<>(); 59 59 60 60 public TagPaster(Collection<PrimitiveData> source, Collection<OsmPrimitive> target) { … … 119 119 120 120 protected Map<OsmPrimitiveType, Integer> getSourceStatistics() { 121 HashMap<OsmPrimitiveType, Integer> ret = new HashMap< OsmPrimitiveType, Integer>();121 HashMap<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< OsmPrimitiveType, Integer>();131 HashMap<OsmPrimitiveType, Integer> ret = new HashMap<>(); 132 132 for (OsmPrimitiveType type: OsmPrimitiveType.dataValues()) { 133 133 int count = OsmPrimitive.getFilteredList(target, type.getOsmClass()).size(); … … 273 273 if (!TextTagParser.validateTags(tags)) return false; 274 274 275 List<Command> commands = new ArrayList< Command>(tags.size());275 List<Command> commands = new ArrayList<>(tags.size()); 276 276 for (Entry<String, String> entry: tags.entrySet()) { 277 277 String v = entry.getValue(); … … 291 291 292 292 PasteTagsAction.TagPaster tagPaster = new PasteTagsAction.TagPaster(directlyAdded, selection); 293 List<Command> commands = new ArrayList< Command>();293 List<Command> commands = new ArrayList<>(); 294 294 for (Tag tag : tagPaster.execute()) { 295 295 commands.add(new ChangePropertyCommand(selection, tag.getKey(), "".equals(tag.getValue()) ? null : tag.getValue())); -
trunk/src/org/openstreetmap/josm/actions/PurgeAction.java
r7001 r7005 95 95 layer = Main.main.getEditLayer(); 96 96 97 toPurge = new HashSet< OsmPrimitive>(sel);98 toPurgeAdditionally = new ArrayList< OsmPrimitive>();99 toPurgeChecked = new HashSet< OsmPrimitive>();97 toPurge = new HashSet<>(sel); 98 toPurgeAdditionally = new ArrayList<>(); 99 toPurgeChecked = new HashSet<>(); 100 100 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< OsmPrimitive>();103 HashSet<OsmPrimitive> toPurgeRecursive = new HashSet<>(); 104 104 while (!toPurge.isEmpty()) { 105 105 … … 117 117 } 118 118 toPurge = toPurgeRecursive; 119 toPurgeRecursive = new HashSet< OsmPrimitive>();120 } 121 122 makeIncomplete = new HashSet< OsmPrimitive>();119 toPurgeRecursive = new HashSet<>(); 120 } 121 122 makeIncomplete = new HashSet<>(); 123 123 124 124 // Find the objects that will be incomplete after purging. … … 143 143 // referrers not yet to-be-purged. 144 144 if (Main.pref.getBoolean("purge.add_untagged_waynodes", true)) { 145 Set<OsmPrimitive> wayNodes = new HashSet< OsmPrimitive>();145 Set<OsmPrimitive> wayNodes = new HashSet<>(); 146 146 for (OsmPrimitive osm : toPurgeChecked) { 147 147 if (osm instanceof Way) { … … 166 166 167 167 if (Main.pref.getBoolean("purge.add_relations_with_only_incomplete_members", true)) { 168 Set<Relation> relSet = new HashSet< Relation>();168 Set<Relation> relSet = new HashSet<>(); 169 169 for (OsmPrimitive osm : toPurgeChecked) { 170 170 for (OsmPrimitive parent : osm.getReferrers()) { … … 180 180 * Add higher level relations (list gets extended while looping over it) 181 181 */ 182 List<Relation> relLst = new ArrayList< Relation>(relSet);182 List<Relation> relLst = new ArrayList<>(relSet); 183 183 for (int i=0; i<relLst.size(); ++i) { 184 184 for (OsmPrimitive parent : relLst.get(i).getReferrers()) { … … 189 189 } 190 190 } 191 relSet = new HashSet< Relation>(relLst);191 relSet = new HashSet<>(relLst); 192 192 toPurgeChecked.addAll(relSet); 193 193 toPurgeAdditionally.addAll(relSet); … … 248 248 } 249 249 }); 250 JList<OsmPrimitive> list = new JList< OsmPrimitive>(toPurgeAdditionally.toArray(new OsmPrimitive[toPurgeAdditionally.size()]));250 JList<OsmPrimitive> list = new JList<>(toPurgeAdditionally.toArray(new OsmPrimitive[toPurgeAdditionally.size()])); 251 251 /* force selection to be active for all entries */ 252 252 list.setCellRenderer(new OsmPrimitivRenderer() { -
trunk/src/org/openstreetmap/josm/actions/RestartAction.java
r6830 r7005 80 80 throw new IOException("Unable to find suitable java runtime at "+java); 81 81 } 82 final List<String> cmd = new ArrayList< String>(Collections.singleton(java));82 final List<String> cmd = new ArrayList<>(Collections.singleton(java)); 83 83 // vm arguments 84 84 for (String arg : ManagementFactory.getRuntimeMXBean().getInputArguments()) { -
trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java
r6380 r7005 47 47 48 48 public Collection<Command> getCommands() { 49 List<Command> c = new ArrayList< Command>();49 List<Command> c = new ArrayList<>(); 50 50 c.addAll(tagCorrectionCommands); 51 51 c.add(reverseCommand); … … 90 90 91 91 boolean propertiesUpdated = false; 92 Collection<Command> c = new LinkedList< Command>();92 Collection<Command> c = new LinkedList<>(); 93 93 for (Way w : sel) { 94 94 ReverseWayResult revResult; -
trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
r6830 r7005 200 200 int maxsize = Math.max(0, Main.pref.getInteger("file-open.history.max-size", 15)); 201 201 Collection<String> oldHistory = Main.pref.getCollection("file-open.history"); 202 List<String> history = new LinkedList< String>(oldHistory);202 List<String> history = new LinkedList<>(oldHistory); 203 203 history.remove(filepath); 204 204 history.add(0, filepath); -
trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java
r6830 r7005 38 38 nodes = null; 39 39 } else { 40 nodes = new TreeSet< Node>();41 outerNodes = new TreeSet< Node>();40 nodes = new TreeSet<>(); 41 outerNodes = new TreeSet<>(); 42 42 43 43 for (Way way : ways) … … 149 149 return; 150 150 151 selection = new LinkedList< OsmPrimitive>();151 selection = new LinkedList<>(); 152 152 for (OsmPrimitive primitive : currentSelection) 153 153 selection.add(primitive); -
trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
r6981 r7005 117 117 } 118 118 119 List<Layer> layersOut = new ArrayList< Layer>();119 List<Layer> layersOut = new ArrayList<>(); 120 120 for (Layer layer : layers) { 121 121 if (exporters.get(layer) == null || !exporters.get(layer).shallExport()) continue; … … 167 167 */ 168 168 public final void initialize() { 169 layers = new ArrayList< Layer>(Main.map.mapView.getAllLayersAsList());170 exporters = new HashMap< Layer, SessionLayerExporter>();171 dependencies = new MultiMap< Layer, Layer>();172 173 Set<Layer> noExporter = new HashSet< Layer>();169 layers = new ArrayList<>(Main.map.mapView.getAllLayersAsList()); 170 exporters = new HashMap<>(); 171 dependencies = new MultiMap<>(); 172 173 Set<Layer> noExporter = new HashSet<>(); 174 174 175 175 for (Layer layer : layers) { -
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r6981 r7005 109 109 final String propJavaHomeAlt = "<java.home>"; 110 110 // Build a new list of VM parameters to modify it below if needed (default implementation returns an UnmodifiableList instance) 111 List<String> vmArguments = new ArrayList< String>(ManagementFactory.getRuntimeMXBean().getInputArguments());111 List<String> vmArguments = new ArrayList<>(ManagementFactory.getRuntimeMXBean().getInputArguments()); 112 112 for (ListIterator<String> it = vmArguments.listIterator(); it.hasNext(); ) { 113 113 String value = it.next(); … … 164 164 settings.remove("oauth.access-token.key"); 165 165 settings.remove("oauth.access-token.secret"); 166 Set<String> keys = new HashSet< String>(settings.keySet());166 Set<String> keys = new HashSet<>(settings.keySet()); 167 167 for (String key : keys) { 168 168 if (key.startsWith("marker.show")) { -
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r6981 r7005 107 107 } 108 108 109 Collection<Command> allCommands = new LinkedList< Command>();109 Collection<Command> allCommands = new LinkedList<>(); 110 110 for (Way way: ways) { 111 111 SequenceCommand simplifyCommand = simplifyWay(way); … … 139 139 boolean isRequired = Collections.frequency(way.getNodes(), node) > 1; 140 140 if (! isRequired) { 141 List<OsmPrimitive> parents = new LinkedList< OsmPrimitive>();141 List<OsmPrimitive> parents = new LinkedList<>(); 142 142 parents.addAll(node.getReferrers()); 143 143 parents.remove(way); … … 171 171 int lower = 0; 172 172 int i = 0; 173 List<Node> newNodes = new ArrayList< Node>(w.getNodesCount());173 List<Node> newNodes = new ArrayList<>(w.getNodesCount()); 174 174 while(i < w.getNodesCount()){ 175 175 if (isRequiredNode(w,w.getNode(i))) { … … 191 191 } 192 192 193 HashSet<Node> delNodes = new HashSet< Node>();193 HashSet<Node> delNodes = new HashSet<>(); 194 194 delNodes.addAll(w.getNodes()); 195 195 delNodes.removeAll(newNodes); … … 197 197 if (delNodes.isEmpty()) return null; 198 198 199 Collection<Command> cmds = new LinkedList< Command>();199 Collection<Command> cmds = new LinkedList<>(); 200 200 Way newWay = new Way(w); 201 201 newWay.setNodes(newNodes); -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r6889 r7005 179 179 List<List<Node>> wayChunks = buildSplitChunks(selectedWay, selectedNodes); 180 180 if (wayChunks != null) { 181 List<OsmPrimitive> sel = new ArrayList< OsmPrimitive>(selectedWays.size() + selectedRelations.size());181 List<OsmPrimitive> sel = new ArrayList<>(selectedWays.size() + selectedRelations.size()); 182 182 sel.addAll(selectedWays); 183 183 sel.addAll(selectedRelations); … … 216 216 217 217 // List of ways shared by all nodes 218 List<Way> result = new ArrayList< Way>(OsmPrimitive.getFilteredList(selectedNodes.get(0).getReferrers(), Way.class));218 List<Way> result = new ArrayList<>(OsmPrimitive.getFilteredList(selectedNodes.get(0).getReferrers(), Way.class)); 219 219 for (int i=1; i<selectedNodes.size(); i++) { 220 220 List<OsmPrimitive> ref = selectedNodes.get(i).getReferrers(); … … 263 263 CheckParameterUtil.ensureParameterNotNull(splitPoints, "splitPoints"); 264 264 265 Set<Node> nodeSet = new HashSet< Node>(splitPoints);266 List<List<Node>> wayChunks = new LinkedList< List<Node>>();267 List<Node> currentWayChunk = new ArrayList< Node>();265 Set<Node> nodeSet = new HashSet<>(splitPoints); 266 List<List<Node>> wayChunks = new LinkedList<>(); 267 List<Node> currentWayChunk = new ArrayList<>(); 268 268 wayChunks.add(currentWayChunk); 269 269 … … 274 274 currentWayChunk.add(currentNode); 275 275 if (nodeSet.contains(currentNode) && !atEndOfWay) { 276 currentWayChunk = new ArrayList< Node>();276 currentWayChunk = new ArrayList<>(); 277 277 currentWayChunk.add(currentNode); 278 278 wayChunks.add(currentWayChunk); … … 335 335 public static SplitWayResult splitWay(OsmDataLayer layer, Way way, List<List<Node>> wayChunks, Collection<? extends OsmPrimitive> selection) { 336 336 // build a list of commands, and also a new selection list 337 Collection<Command> commandList = new ArrayList< Command>(wayChunks.size());338 List<OsmPrimitive> newSelection = new ArrayList< OsmPrimitive>(selection.size() + wayChunks.size());337 Collection<Command> commandList = new ArrayList<>(wayChunks.size()); 338 List<OsmPrimitive> newSelection = new ArrayList<>(selection.size() + wayChunks.size()); 339 339 newSelection.addAll(selection); 340 340 … … 351 351 } 352 352 353 List<Way> newWays = new ArrayList< Way>();353 List<Way> newWays = new ArrayList<>(); 354 354 // Second, create new ways 355 355 while (chunkIt.hasNext()) { … … 393 393 } 394 394 } 395 List<Node> nodes = new ArrayList< Node>();395 List<Node> nodes = new ArrayList<>(); 396 396 if(via != null) { 397 397 if(via instanceof Node) { -
trunk/src/org/openstreetmap/josm/actions/ToggleAction.java
r6338 r7005 23 23 public abstract class ToggleAction extends JosmAction { 24 24 25 private final List<ButtonModel> buttonModels = new ArrayList< ButtonModel>();25 private final List<ButtonModel> buttonModels = new ArrayList<>(); 26 26 27 27 /** -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r6981 r7005 106 106 return; 107 107 } 108 Set<Node> tmpNodes = new HashSet< Node>();108 Set<Node> tmpNodes = new HashSet<>(); 109 109 for (Node n : selectedNodes) { 110 110 int count = 0; … … 165 165 */ 166 166 private void unglueNode(ActionEvent e) { 167 LinkedList<Command> cmds = new LinkedList< Command>();167 LinkedList<Command> cmds = new LinkedList<>(); 168 168 169 169 Node c = new Node(selectedNode); … … 274 274 return false; 275 275 276 selectedNodes = new HashSet< Node>();276 selectedNodes = new HashSet<>(); 277 277 for (OsmPrimitive p : selection) { 278 278 if (p instanceof Node) { … … 307 307 cmds.add(new AddCommand(newNode)); 308 308 309 List<Node> nn = new ArrayList< Node>();309 List<Node> nn = new ArrayList<>(); 310 310 for (Node pushNode : w.getNodes()) { 311 311 if (originalNode == pushNode) { … … 337 337 if (newRel == null) { 338 338 newRel = new Relation(r); 339 rolesToReAdd = new HashSet< String>();339 rolesToReAdd = new HashSet<>(); 340 340 } 341 341 rolesToReAdd.add(rm.getRole()); … … 359 359 */ 360 360 private void unglueWays() { 361 LinkedList<Command> cmds = new LinkedList< Command>();362 LinkedList<Node> newNodes = new LinkedList< Node>();361 LinkedList<Command> cmds = new LinkedList<>(); 362 LinkedList<Node> newNodes = new LinkedList<>(); 363 363 364 364 if (selectedWay == null) { 365 365 Way wayWithSelectedNode = null; 366 LinkedList<Way> parentWays = new LinkedList< Way>();366 LinkedList<Way> parentWays = new LinkedList<>(); 367 367 for (OsmPrimitive osm : selectedNode.getReferrers()) { 368 368 if (osm.isUsable() && osm instanceof Way) { … … 407 407 private boolean unglueSelfCrossingWay() { 408 408 // According to previous check, only one valid way through that node 409 LinkedList<Command> cmds = new LinkedList< Command>();409 LinkedList<Command> cmds = new LinkedList<>(); 410 410 Way way = null; 411 411 for (Way w: OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) … … 414 414 } 415 415 List<Node> oldNodes = way.getNodes(); 416 ArrayList<Node> newNodes = new ArrayList< Node>(oldNodes.size());417 ArrayList<Node> addNodes = new ArrayList< Node>();416 ArrayList<Node> newNodes = new ArrayList<>(oldNodes.size()); 417 ArrayList<Node> addNodes = new ArrayList<>(); 418 418 boolean seen = false; 419 419 for (Node n: oldNodes) { … … 449 449 */ 450 450 private void unglueWays2() { 451 LinkedList<Command> cmds = new LinkedList< Command>();452 List<Node> allNewNodes = new LinkedList< Node>();451 LinkedList<Command> cmds = new LinkedList<>(); 452 List<Node> allNewNodes = new LinkedList<>(); 453 453 Way tmpWay = selectedWay; 454 454 455 455 for (Node n : selectedNodes) { 456 List<Node> newNodes = new LinkedList< Node>();456 List<Node> newNodes = new LinkedList<>(); 457 457 tmpWay = modifyWay(n, tmpWay, cmds, newNodes); 458 458 fixRelations(n, cmds, newNodes); … … 481 481 482 482 protected boolean checkAndConfirmOutlyingUnglue() { 483 List<OsmPrimitive> primitives = new ArrayList< OsmPrimitive>(2 + (selectedNodes == null ? 0 : selectedNodes.size()));483 List<OsmPrimitive> primitives = new ArrayList<>(2 + (selectedNodes == null ? 0 : selectedNodes.size())); 484 484 if (selectedNodes != null) 485 485 primitives.addAll(selectedNodes); -
trunk/src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java
r6986 r7005 99 99 100 100 // List of ways shared by all nodes 101 List<Way> result = new ArrayList< Way>(OsmPrimitive.getFilteredList(selectedNodes.get(0).getReferrers(), Way.class));101 List<Way> result = new ArrayList<>(OsmPrimitive.getFilteredList(selectedNodes.get(0).getReferrers(), Way.class)); 102 102 for (int i=1; i<selectedNodes.size(); i++) { 103 103 List<OsmPrimitive> ref = selectedNodes.get(i).getReferrers(); -
trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java
r6643 r7005 51 51 return; 52 52 53 List<Area> areas = new ArrayList< Area>();53 List<Area> areas = new ArrayList<>(); 54 54 for(DataSource ds : getEditLayer().data.dataSources) { 55 55 areas.add(new Area(ds.bounds.asRect())); … … 72 72 } 73 73 74 List<Area> areasToDownload = new ArrayList< Area>();74 List<Area> areasToDownload = new ArrayList<>(); 75 75 for(Area a : areas) { 76 76 if(a.isEmpty()) { -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r6654 r7005 53 53 * however, a plugin might also want to insert something after that. 54 54 */ 55 private static final List<UploadHook> uploadHooks = new LinkedList< UploadHook>();56 private static final List<UploadHook> lateUploadHooks = new LinkedList< UploadHook>();55 private static final List<UploadHook> uploadHooks = new LinkedList<>(); 56 private static final List<UploadHook> lateUploadHooks = new LinkedList<>(); 57 57 static { 58 58 /** … … 232 232 @Override 233 233 public void run() { 234 final HashMap<String, String> tags = new HashMap< String, String>(layer.data.getChangeSetTags());234 final HashMap<String, String> tags = new HashMap<>(layer.data.getChangeSetTags()); 235 235 if (!tags.containsKey("source")) { 236 236 tags.put("source", dialog.getLastChangesetSourceFromHistory()); -
trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
r6380 r7005 66 66 67 67 protected Set<OsmPrimitive> getDeletedPrimitives(DataSet ds) { 68 HashSet<OsmPrimitive> ret = new HashSet< OsmPrimitive>();68 HashSet<OsmPrimitive> ret = new HashSet<>(); 69 69 for (OsmPrimitive p: ds.allPrimitives()) { 70 70 if (p.isDeleted() && !p.isNew() && p.isVisible() && p.isModified()) { … … 76 76 77 77 protected Set<OsmPrimitive> getModifiedPrimitives(Collection<OsmPrimitive> primitives) { 78 HashSet<OsmPrimitive> ret = new HashSet< OsmPrimitive>();78 HashSet<OsmPrimitive> ret = new HashSet<>(); 79 79 for (OsmPrimitive p: primitives) { 80 80 if (p.isNewOrUndeleted()) { … … 188 188 189 189 public UploadHullBuilder(){ 190 hull = new HashSet< OsmPrimitive>();190 hull = new HashSet<>(); 191 191 } 192 192 … … 243 243 public Set<OsmPrimitive> build(Collection<OsmPrimitive> base) throws IllegalArgumentException{ 244 244 CheckParameterUtil.ensureParameterNotNull(base, "base"); 245 hull = new HashSet< OsmPrimitive>();245 hull = new HashSet<>(); 246 246 for (OsmPrimitive p: base) { 247 247 p.accept(this); … … 303 303 */ 304 304 protected Set<OsmPrimitive> getPrimitivesToCheckForParents() { 305 HashSet<OsmPrimitive> ret = new HashSet< OsmPrimitive>();305 HashSet<OsmPrimitive> ret = new HashSet<>(); 306 306 for (OsmPrimitive p: toUpload) { 307 307 if (p.isDeleted() && !p.isNewOrUndeleted()) { … … 315 315 protected void realRun() throws SAXException, IOException, OsmTransferException { 316 316 try { 317 Stack<OsmPrimitive> toCheck = new Stack< OsmPrimitive>();317 Stack<OsmPrimitive> toCheck = new Stack<>(); 318 318 toCheck.addAll(getPrimitivesToCheckForParents()); 319 Set<OsmPrimitive> checked = new HashSet< OsmPrimitive>();319 Set<OsmPrimitive> checked = new HashSet<>(); 320 320 while(!toCheck.isEmpty()) { 321 321 if (canceled) return; -
trunk/src/org/openstreetmap/josm/actions/ValidateAction.java
r6779 r7005 160 160 if (tests == null || tests.isEmpty()) 161 161 return; 162 errors = new ArrayList< TestError>(200);162 errors = new ArrayList<>(200); 163 163 getProgressMonitor().setTicksCount(tests.size() * validatedPrimitives.size()); 164 164 int testCounter = 0; … … 179 179 for (TestError error : errors) { 180 180 if (canceled) return; 181 List<String> s = new ArrayList< String>();181 List<String> s = new ArrayList<>(); 182 182 s.add(error.getIgnoreState()); 183 183 s.add(error.getIgnoreGroup()); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java
r6085 r7005 16 16 17 17 public AbstractDownloadTask() { 18 errorMessages = new ArrayList< Object>();18 errorMessages = new ArrayList<>(); 19 19 } 20 20 -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java
r6920 r7005 103 103 // A changeset does not contain all referred primitives, this is the map of incomplete ones 104 104 // For each incomplete primitive, we'll have to get its state at date it was referred 105 Map<OsmPrimitive, Date> toLoad = new HashMap< OsmPrimitive, Date>();105 Map<OsmPrimitive, Date> toLoad = new HashMap<>(); 106 106 for (OsmPrimitive p : downloadedData.allNonDeletedPrimitives()) { 107 107 if (p.isIncomplete()) { … … 142 142 @Override 143 143 public void historyUpdated(HistoryDataSet source, PrimitiveId id) { 144 Map<OsmPrimitive, Date> toLoadNext = new HashMap< OsmPrimitive, Date>();144 Map<OsmPrimitive, Date> toLoadNext = new HashMap<>(); 145 145 for (Iterator<OsmPrimitive> it = toLoad.keySet().iterator(); it.hasNext();) { 146 146 OsmPrimitive p = it.next(); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r6920 r7005 309 309 if (urlString.matches(PATTERN_OSM_API_URL)) { 310 310 // TODO: proper i18n after stabilization 311 Collection<String> items = new ArrayList< String>();311 Collection<String> items = new ArrayList<>(); 312 312 items.add(tr("OSM Server URL:") + " " + url.getHost()); 313 313 items.add(tr("Command")+": "+url.getPath()); -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTask.java
r6973 r7005 62 62 CheckParameterUtil.ensureParameterNotNull(targetLayer, "targetLayer"); 63 63 canceled = false; 64 this.children = new HashMap< Long, OsmPrimitiveType>();64 this.children = new HashMap<>(); 65 65 if (children != null) { 66 66 for (OsmPrimitive p: children) { … … 85 85 CheckParameterUtil.ensureParameterNotNull(targetLayer, "targetLayer"); 86 86 canceled = false; 87 this.children = new HashMap< Long, OsmPrimitiveType>();87 this.children = new HashMap<>(); 88 88 if (children != null) { 89 89 for (Entry<Long, OsmPrimitiveType> entry : children.entrySet()) { … … 115 115 CheckParameterUtil.ensureParameterNotNull(type, "type"); 116 116 canceled = false; 117 this.children = new HashMap< Long, OsmPrimitiveType>();117 this.children = new HashMap<>(); 118 118 this.children.put(id, type); 119 119 this.targetLayer = targetLayer; … … 151 151 throw new IllegalArgumentException(MessageFormat.format("Cannot download referrers for new primitives (ID {0})", primitiveId.getUniqueId())); 152 152 canceled = false; 153 this.children = new HashMap< Long, OsmPrimitiveType>();153 this.children = new HashMap<>(); 154 154 this.children.put(primitiveId.getUniqueId(), primitiveId.getType()); 155 155 this.targetLayer = targetLayer; … … 215 215 DataSetMerger merger; 216 216 if (!ways.isEmpty()) { 217 Set<Node> nodes = new HashSet< Node>();217 Set<Node> nodes = new HashSet<>(); 218 218 for (Way w: ways) { 219 219 // Ensure each node is only listed once -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
r6643 r7005 44 44 */ 45 45 public class DownloadTaskList { 46 private List<DownloadTask> tasks = new LinkedList< DownloadTask>();47 private List<Future<?>> taskFutures = new LinkedList< Future<?>>();46 private List<DownloadTask> tasks = new LinkedList<>(); 47 private List<Future<?>> taskFutures = new LinkedList<>(); 48 48 private ProgressMonitor progressMonitor; 49 49 … … 108 108 progressMonitor.beginTask(tr("Updating data")); 109 109 try { 110 List<Rectangle2D> rects = new ArrayList< Rectangle2D>(areas.size());110 List<Rectangle2D> rects = new ArrayList<>(areas.size()); 111 111 for (Area a : areas) { 112 112 rects.add(a.getBounds2D()); … … 126 126 */ 127 127 protected Set<OsmPrimitive> getCompletePrimitives(DataSet ds) { 128 HashSet<OsmPrimitive> ret = new HashSet< OsmPrimitive>();128 HashSet<OsmPrimitive> ret = new HashSet<>(); 129 129 for (OsmPrimitive primitive : ds.allPrimitives()) { 130 130 if (!primitive.isIncomplete() && !primitive.isNew()) { … … 142 142 */ 143 143 protected void updatePotentiallyDeletedPrimitives(Set<OsmPrimitive> potentiallyDeleted) { 144 final List<OsmPrimitive> toSelect = new ArrayList< OsmPrimitive>();144 final List<OsmPrimitive> toSelect = new ArrayList<>(); 145 145 for (OsmPrimitive primitive : potentiallyDeleted) { 146 146 if (primitive != null) { … … 216 216 */ 217 217 public Set<OsmPrimitive> getDownloadedPrimitives() { 218 HashSet<OsmPrimitive> ret = new HashSet< OsmPrimitive>();218 HashSet<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< Object>();255 LinkedHashSet<Object> errors = new LinkedHashSet<>(); 256 256 for (DownloadTask dt : tasks) { 257 257 errors.addAll(dt.getErrorObjects()); 258 258 } 259 259 if (!errors.isEmpty()) { 260 final Collection<String> items = new ArrayList< String>();260 final Collection<String> items = new ArrayList<>(); 261 261 for (Object error : errors) { 262 262 if (error instanceof String) { -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
r6643 r7005 29 29 public PostDownloadHandler(DownloadTask task, Future<?> future) { 30 30 this.task = task; 31 this.futures = new ArrayList< Future<?>>();31 this.futures = new ArrayList<>(); 32 32 if (future != null) { 33 33 this.futures.add(future); … … 42 42 public PostDownloadHandler(DownloadTask task, Future<?> ... futures) { 43 43 this.task = task; 44 this.futures = new ArrayList< Future<?>>();44 this.futures = new ArrayList<>(); 45 45 if (futures == null) return; 46 46 for (Future<?> future: futures) { … … 56 56 public PostDownloadHandler(DownloadTask task, List<Future<?>> futures) { 57 57 this.task = task; 58 this.futures = new ArrayList< Future<?>>();58 this.futures = new ArrayList<>(); 59 59 if (futures == null) return; 60 60 this.futures.addAll(futures); … … 77 77 // make sure errors are reported only once 78 78 // 79 LinkedHashSet<Object> errors = new LinkedHashSet< Object>();79 LinkedHashSet<Object> errors = new LinkedHashSet<>(); 80 80 errors.addAll(task.getErrorObjects()); 81 81 if (errors.isEmpty()) … … 106 106 // 107 107 if (!errors.isEmpty()) { 108 final Collection<String> items = new ArrayList< String>();108 final Collection<String> items = new ArrayList<>(); 109 109 for (Object error:errors) { 110 110 if (error instanceof String) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r6889 r7005 194 194 return; 195 195 196 Set<OsmPrimitive> newHighlights = new HashSet< OsmPrimitive>();196 Set<OsmPrimitive> newHighlights = new HashSet<>(); 197 197 DeleteParameters parameters = getDeleteParameters(e, modifiers); 198 198 -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r6920 r7005 90 90 91 91 private Node mouseOnExistingNode; 92 private Set<Way> mouseOnExistingWays = new HashSet< Way>();92 private Set<Way> mouseOnExistingWays = new HashSet<>(); 93 93 // old highlights store which primitives are currently highlighted. This 94 94 // is true, even if target highlighting is disabled since the status bar 95 95 // derives its information from this list as well. 96 private Set<OsmPrimitive> oldHighlights = new HashSet< OsmPrimitive>();96 private Set<OsmPrimitive> oldHighlights = new HashSet<>(); 97 97 // new highlights contains a list of primitives that should be highlighted 98 98 // but haven’t been so far. The idea is to compare old and new and only 99 99 // repaint if there are changes. 100 private Set<OsmPrimitive> newHighlights = new HashSet< OsmPrimitive>();100 private Set<OsmPrimitive> newHighlights = new HashSet<>(); 101 101 private boolean drawHelperLine; 102 102 private boolean wayIsFinished = false; … … 306 306 307 307 // events for crossplatform key holding processing 308 private final Set<Integer> set = new TreeSet< Integer>();308 private final Set<Integer> set = new TreeSet<>(); 309 309 private KeyEvent releaseEvent; 310 310 private Timer timer; … … 425 425 426 426 DataSet ds = getCurrentDataSet(); 427 Collection<OsmPrimitive> selection = new ArrayList< OsmPrimitive>(ds.getSelected());428 Collection<Command> cmds = new LinkedList< Command>();429 Collection<OsmPrimitive> newSelection = new LinkedList< OsmPrimitive>(ds.getSelected());430 431 List<Way> reuseWays = new ArrayList< Way>(),432 replacedWays = new ArrayList< Way>();427 Collection<OsmPrimitive> selection = new ArrayList<>(ds.getSelected()); 428 Collection<Command> cmds = new LinkedList<>(); 429 Collection<OsmPrimitive> newSelection = new LinkedList<>(ds.getSelected()); 430 431 List<Way> reuseWays = new ArrayList<>(), 432 replacedWays = new ArrayList<>(); 433 433 boolean newNode = false; 434 434 Node n = null; … … 658 658 659 659 private void insertNodeIntoAllNearbySegments(List<WaySegment> wss, Node n, Collection<OsmPrimitive> newSelection, Collection<Command> cmds, List<Way> replacedWays, List<Way> reuseWays) { 660 Map<Way, List<Integer>> insertPoints = new HashMap< Way, List<Integer>>();660 Map<Way, List<Integer>> insertPoints = new HashMap<>(); 661 661 for (WaySegment ws : wss) { 662 662 List<Integer> is; … … 664 664 is = insertPoints.get(ws.way); 665 665 } else { 666 is = new ArrayList< Integer>();666 is = new ArrayList<>(); 667 667 insertPoints.put(ws.way, is); 668 668 } … … 671 671 } 672 672 673 Set<Pair<Node,Node>> segSet = new HashSet< Pair<Node,Node>>();673 Set<Pair<Node,Node>> segSet = new HashSet<>(); 674 674 675 675 for (Map.Entry<Way, List<Integer>> insertPoint : insertPoints.entrySet()) { … … 681 681 pruneSuccsAndReverse(is); 682 682 for (int i : is) { 683 segSet.add(Pair.sort(new Pair< Node,Node>(w.getNode(i), w.getNode(i+1))));683 segSet.add(Pair.sort(new Pair<>(w.getNode(i), w.getNode(i+1)))); 684 684 } 685 685 for (int i : is) { … … 814 814 Node currentMouseNode = null; 815 815 mouseOnExistingNode = null; 816 mouseOnExistingWays = new HashSet< Way>();816 mouseOnExistingWays = new HashSet<>(); 817 817 818 818 showStatusInfo(-1, -1, -1, snapHelper.isSnapOn()); … … 980 980 981 981 private static void pruneSuccsAndReverse(List<Integer> is) { 982 HashSet<Integer> is2 = new HashSet< Integer>();982 HashSet<Integer> is2 = new HashSet<>(); 983 983 for (int i : is) { 984 984 if (!is2.contains(i - 1) && !is2.contains(i + 1)) { … … 1093 1093 */ 1094 1094 private void addHighlighting() { 1095 newHighlights = new HashSet< OsmPrimitive>();1095 newHighlights = new HashSet<>(); 1096 1096 1097 1097 // if ctrl key is held ("no join"), don't highlight anything … … 1132 1132 */ 1133 1133 private boolean removeHighlighting() { 1134 newHighlights = new HashSet< OsmPrimitive>();1134 newHighlights = new HashSet<>(); 1135 1135 return redrawIfRequired(); 1136 1136 } … … 1570 1570 if (selectedWays.size()==1) { 1571 1571 Way w = selectedWays.iterator().next(); 1572 Collection <EastNorth> pointsToProject = new ArrayList< EastNorth>();1572 Collection <EastNorth> pointsToProject = new ArrayList<>(); 1573 1573 if (w.getNodesCount()<1000) { 1574 1574 for (Node n: w.getNodes()) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r6889 r7005 257 257 if (selectedNode != null) { 258 258 if (ctrl || nodeDragWithoutCtrl) { 259 movingNodeList = new ArrayList< OsmPrimitive>();259 movingNodeList = new ArrayList<>(); 260 260 movingNodeList.add(selectedNode); 261 261 calculatePossibleDirectionsByNode(); … … 270 270 if (ctrl) { 271 271 mode = Mode.translate; 272 movingNodeList = new ArrayList< OsmPrimitive>();272 movingNodeList = new ArrayList<>(); 273 273 movingNodeList.add(selectedSegment.getFirstNode()); 274 274 movingNodeList.add(selectedSegment.getSecondNode()); … … 417 417 if (selectedSegment == null) return; 418 418 // crete a new rectangle 419 Collection<Command> cmds = new LinkedList< Command>();419 Collection<Command> cmds = new LinkedList<>(); 420 420 Node third = new Node(newN2en); 421 421 Node fourth = new Node(newN1en); … … 441 441 private void performExtrusion() { 442 442 // create extrusion 443 Collection<Command> cmds = new LinkedList< Command>();443 Collection<Command> cmds = new LinkedList<>(); 444 444 Way wnew = new Way(selectedSegment.way); 445 445 boolean wayWasModified = false; … … 593 593 594 594 //add direction perpendicular to the selected segment 595 possibleMoveDirections = new ArrayList< ReferenceSegment>();595 possibleMoveDirections = new ArrayList<>(); 596 596 possibleMoveDirections.add(new ReferenceSegment(new EastNorth( 597 597 initialN1en.getY() - initialN2en.getY(), … … 627 627 initialN1en = selectedNode.getEastNorth(); 628 628 initialN2en = initialN1en; 629 possibleMoveDirections = new ArrayList< ReferenceSegment>();629 possibleMoveDirections = new ArrayList<>(); 630 630 for (OsmPrimitive p: selectedNode.getReferrers()) { 631 631 if (p instanceof Way && p.isUsable()) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r6889 r7005 389 389 // Important: If there are other ways containing the same 390 390 // segment, a node must added to all of that ways. 391 Collection<Command> virtualCmds = new LinkedList< Command>();391 Collection<Command> virtualCmds = new LinkedList<>(); 392 392 393 393 // Creating a new node … … 406 406 Way.class); 407 407 408 Collection<WaySegment> virtualSegments = new LinkedList< WaySegment>();408 Collection<WaySegment> virtualSegments = new LinkedList<>(); 409 409 for (Way w : firstNodeWays) { 410 410 List<Pair<Node, Node>> wpps = w.getNodePairs(true); … … 456 456 tr("Error"), JOptionPane.ERROR_MESSAGE); 457 457 } else { 458 List<Node> nodeList = new ArrayList< Node>();458 List<Node> nodeList = new ArrayList<>(); 459 459 nodeList.add(candidateNode); 460 460 Command deleteCmd = DeleteCommand.delete(getEditLayer(), nodeList, true); … … 600 600 */ 601 601 private void updateStateByCurrentSelection() { 602 final List<Node> nodeList = new ArrayList< Node>();603 final List<Way> wayList = new ArrayList< Way>();602 final List<Node> nodeList = new ArrayList<>(); 603 final List<Way> wayList = new ArrayList<>(); 604 604 final Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected(); 605 605 -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
r6992 r7005 166 166 Main.warn(ex); 167 167 } 168 sourceWays = new LinkedHashSet< Way>(getCurrentDataSet().getSelectedWays());168 sourceWays = new LinkedHashSet<>(getCurrentDataSet().getSelectedWays()); 169 169 for (Way w : sourceWays) { 170 170 w.setHighlighted(true); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java
r6889 r7005 40 40 // Make a deep copy of the ways, keeping the copied ways connected 41 41 // TODO: This assumes the first/last nodes of the ways are the only possible shared nodes. 42 HashMap<Node, Node> splitNodeMap = new HashMap< Node, Node>(sourceWays.size());42 HashMap<Node, Node> splitNodeMap = new HashMap<>(sourceWays.size()); 43 43 for (Way w : sourceWays) { 44 44 if (!splitNodeMap.containsKey(w.firstNode())) { … … 49 49 } 50 50 } 51 ways = new ArrayList< Way>(sourceWays.size());51 ways = new ArrayList<>(sourceWays.size()); 52 52 for (Way w : sourceWays) { 53 53 Way wCopy = new Way(); … … 71 71 72 72 // Fix #8631 - Remove duplicated nodes from graph to be robust with self-intersecting ways 73 Set<Node> removedNodes = new HashSet< Node>();74 sortedNodes = new ArrayList< Node>();73 Set<Node> removedNodes = new HashSet<>(); 74 sortedNodes = new ArrayList<>(); 75 75 for (int i = 0; i < sortedNodesPath.size(); i++) { 76 76 Node n = sortedNodesPath.get(i); … … 178 178 179 179 private List<Command> makeAddWayAndNodesCommandList() { 180 List<Command> commands = new ArrayList< Command>(sortedNodes.size() + ways.size());180 List<Command> commands = new ArrayList<>(sortedNodes.size() + ways.size()); 181 181 for (int i = 0; i < sortedNodes.size() - (isClosedPath() ? 1 : 0); i++) { 182 182 commands.add(new AddCommand(sortedNodes.get(i))); -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r7000 r7005 160 160 * set would have to be checked. 161 161 */ 162 private Set<OsmPrimitive> oldHighlights = new HashSet< OsmPrimitive>();162 private Set<OsmPrimitive> oldHighlights = new HashSet<>(); 163 163 164 164 /** … … 254 254 determineMapMode(!c.isEmpty()); 255 255 256 HashSet<OsmPrimitive> newHighlights = new HashSet< OsmPrimitive>();256 HashSet<OsmPrimitive> newHighlights = new HashSet<>(); 257 257 258 258 virtualManager.clear(); … … 362 362 prim.setHighlighted(false); 363 363 } 364 oldHighlights = new HashSet< OsmPrimitive>();364 oldHighlights = new HashSet<>(); 365 365 return true; 366 366 } … … 846 846 return; 847 847 848 Collection<Node> nodesToMerge = new LinkedList< Node>(selNodes);848 Collection<Node> nodesToMerge = new LinkedList<>(selNodes); 849 849 nodesToMerge.add(target); 850 850 MergeNodesAction.doMergeNodes(Main.main.getEditLayer(), nodesToMerge, target); … … 1074 1074 1075 1075 private Node virtualNode = null; 1076 private Collection<WaySegment> virtualWays = new LinkedList< WaySegment>();1076 private Collection<WaySegment> virtualWays = new LinkedList<>(); 1077 1077 private int nodeVirtualSize; 1078 1078 private int virtualSnapDistSq2; … … 1100 1100 if (nodeVirtualSize > 0) { 1101 1101 1102 Collection<WaySegment> selVirtualWays = new LinkedList< WaySegment>();1103 Pair<Node, Node> vnp = null, wnp = new Pair< Node, Node>(null, null);1102 Collection<WaySegment> selVirtualWays = new LinkedList<>(); 1103 Pair<Node, Node> vnp = null, wnp = new Pair<>(null, null); 1104 1104 1105 1105 Way w = null; … … 1117 1117 Pair.sort(wnp); 1118 1118 if (vnp == null) { 1119 vnp = new Pair< Node, Node>(wnp.a, wnp.b);1119 vnp = new Pair<>(wnp.a, wnp.b); 1120 1120 virtualNode = new Node(mv.getLatLon(pc.getX(), pc.getY())); 1121 1121 } … … 1139 1139 1140 1140 private void createMiddleNodeFromVirtual(EastNorth currentEN) { 1141 Collection<Command> virtualCmds = new LinkedList< Command>();1141 Collection<Command> virtualCmds = new LinkedList<>(); 1142 1142 virtualCmds.add(new AddCommand(virtualNode)); 1143 1143 for (WaySegment virtualWay : virtualWays) { -
trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java
r5821 r7005 24 24 return Collections.<Relation>emptySet(); 25 25 } else { 26 return new SubclassFilteredCollection< OsmPrimitive, Relation>(26 return new SubclassFilteredCollection<>( 27 27 primitives, OsmPrimitive.relationPredicate); 28 28 } 29 29 } 30 30 31 /* (non-Javadoc)32 * @see org.openstreetmap.josm.actions.relation.RelationAction#setPrimitives33 */34 31 @Override 35 32 public void setPrimitives(Collection<? extends OsmPrimitive> primitives) { -
trunk/src/org/openstreetmap/josm/actions/relation/AddSelectionToRelations.java
r5799 r7005 31 31 @Override 32 32 public void actionPerformed(ActionEvent e) { 33 Collection<Command> cmds = new LinkedList< Command>();33 Collection<Command> cmds = new LinkedList<>(); 34 34 for (Relation orig : relations) { 35 35 Command c = GenericRelationEditor.addPrimitivesToRelation(orig, Main.main.getCurrentDataSet().getSelected()); -
trunk/src/org/openstreetmap/josm/actions/relation/DownloadSelectedIncompleteMembersAction.java
r6336 r7005 38 38 */ 39 39 public Set<OsmPrimitive> buildSetOfIncompleteMembers(Collection<Relation> rels) { 40 Set<OsmPrimitive> ret = new HashSet< OsmPrimitive>();40 Set<OsmPrimitive> ret = new HashSet<>(); 41 41 for (Relation r : rels) { 42 42 ret.addAll(r.getIncompleteMembers()); -
trunk/src/org/openstreetmap/josm/actions/relation/EditRelationAction.java
r6806 r7005 41 41 */ 42 42 public static Set<RelationMember> getMembersForCurrentSelection(Relation r) { 43 Set<RelationMember> members = new HashSet< RelationMember>();43 Set<RelationMember> members = new HashSet<>(); 44 44 if (Main.isDisplayingMapView()) { 45 45 OsmDataLayer editLayer = Main.main.getEditLayer(); -
trunk/src/org/openstreetmap/josm/actions/relation/SelectMembersAction.java
r6986 r7005 36 36 if (!isEnabled() || relations.isEmpty() || !Main.isDisplayingMapView()) return; 37 37 38 HashSet<OsmPrimitive> members = new HashSet< OsmPrimitive>();38 HashSet<OsmPrimitive> members = new HashSet<>(); 39 39 for (Relation r: relations) { 40 40 members.addAll(r.getMemberPrimitives()); -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r6844 r7005 84 84 } 85 85 86 private static final LinkedList<SearchSetting> searchHistory = new LinkedList< SearchSetting>();86 private static final LinkedList<SearchSetting> searchHistory = new LinkedList<>(); 87 87 static { 88 88 for (String s: Main.pref.getCollection("search.history", Collections.<String>emptyList())) { … … 110 110 searchHistory.removeLast(); 111 111 } 112 LinkedHashSet<String> savedHistory = new LinkedHashSet< String>(searchHistory.size());112 LinkedHashSet<String> savedHistory = new LinkedHashSet<>(searchHistory.size()); 113 113 for (SearchSetting item: searchHistory) { 114 114 savedHistory.add(item.writeToString()); … … 118 118 119 119 public static List<String> getSearchExpressionHistory() { 120 List<String> ret = new ArrayList< String>(getSearchHistory().size());120 List<String> ret = new ArrayList<>(getSearchHistory().size()); 121 121 for (SearchSetting ss: getSearchHistory()) { 122 122 ret.add(ss.text); … … 582 582 583 583 final DataSet ds = Main.main.getCurrentDataSet(); 584 Collection<OsmPrimitive> sel = new HashSet< OsmPrimitive>(ds.getAllSelected());584 Collection<OsmPrimitive> sel = new HashSet<>(ds.getAllSelected()); 585 585 int foundMatches = getSelection(s, sel, new Predicate<OsmPrimitive>(){ 586 586 @Override -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r6990 r7005 59 59 private static String rxErrorMsgNoPos = marktr("The regex \"{0}\" had a parse error, full error:\n\n{1}"); 60 60 private PushbackTokenizer tokenizer; 61 private static Map<String, SimpleMatchFactory> simpleMatchFactoryMap = new HashMap< String, SimpleMatchFactory>();62 private static Map<String, UnaryMatchFactory> unaryMatchFactoryMap = new HashMap< String, UnaryMatchFactory>();63 private static Map<String, BinaryMatchFactory> binaryMatchFactoryMap = new HashMap< String, BinaryMatchFactory>();61 private static Map<String, SimpleMatchFactory> simpleMatchFactoryMap = new HashMap<>(); 62 private static Map<String, UnaryMatchFactory> unaryMatchFactoryMap = new HashMap<>(); 63 private static Map<String, BinaryMatchFactory> binaryMatchFactoryMap = new HashMap<>(); 64 64 65 65 public SearchCompiler(boolean caseSensitive, boolean regexSearch, PushbackTokenizer tokenizer) { -
trunk/src/org/openstreetmap/josm/actions/upload/CyclicUploadDependencyException.java
r6987 r7005 45 45 46 46 public List<Relation> getCyclicUploadDependency() { 47 return new ArrayList< Relation>(cycle);47 return new ArrayList<>(cycle); 48 48 } 49 49 } -
trunk/src/org/openstreetmap/josm/actions/upload/DiscardTagsHook.java
r5608 r7005 24 24 public boolean checkUpload(APIDataSet apiDataSet) { 25 25 List<OsmPrimitive> objectsToUpload = apiDataSet.getPrimitives(); 26 Collection<String> discardableKeys = new HashSet< String>(OsmPrimitive.getDiscardableKeys());26 Collection<String> discardableKeys = new HashSet<>(OsmPrimitive.getDiscardableKeys()); 27 27 28 28 boolean needsChange = false; … … 37 37 38 38 if (needsChange) { 39 AbstractMap<String, String> map = new HashMap< String, String>();39 AbstractMap<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
r6922 r7005 30 30 * List of checks to run on data 31 31 */ 32 private List<FixData> deprecated = new LinkedList< FixData>();32 private List<FixData> deprecated = new LinkedList<>(); 33 33 34 34 /** … … 76 76 @Override 77 77 public boolean fixKeys(Map<String, String> keys, OsmPrimitive osm) { 78 Map<String, String> newKeys = new HashMap< String, String>(keys);78 Map<String, String> newKeys = new HashMap<>(keys); 79 79 for (Entry<String, String> e : keys.entrySet()) { 80 80 String v = Tag.removeWhiteSpaces(e.getValue()); … … 184 184 185 185 List<OsmPrimitive> objectsToUpload = apiDataSet.getPrimitives(); 186 Collection<Command> cmds = new LinkedList< Command>();186 Collection<Command> cmds = new LinkedList<>(); 187 187 188 188 for (OsmPrimitive osm : objectsToUpload) { … … 195 195 } 196 196 if(modified) 197 cmds.add(new ChangePropertyCommand(Collections.singleton(osm), new HashMap< String, String>(keys)));197 cmds.add(new ChangePropertyCommand(Collections.singleton(osm), new HashMap<>(keys))); 198 198 } 199 199 } -
trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
r6786 r7005 54 54 Collection<OsmPrimitive> selection = v.visit(apiDataSet.getPrimitivesToUpdate()); 55 55 56 List<TestError> errors = new ArrayList< TestError>(30);56 List<TestError> errors = new ArrayList<>(30); 57 57 for (Test test : tests) { 58 58 test.setBeforeUpload(true); … … 83 83 int nume = 0; 84 84 for (TestError error : errors) { 85 List<String> s = new ArrayList< String>();85 List<String> s = new ArrayList<>(); 86 86 s.add(error.getIgnoreState()); 87 87 s.add(error.getIgnoreGroup());
Note:
See TracChangeset
for help on using the changeset viewer.