Changeset 8856 in josm
- Timestamp:
- 2015-10-11T15:28:33+02:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r8855 r8856 8 8 import java.awt.event.ActionEvent; 9 9 import java.awt.event.KeyEvent; 10 import java.util.ArrayDeque;11 10 import java.util.ArrayList; 12 11 import java.util.Collection; 13 12 import java.util.Collections; 14 import java.util.Deque;15 13 import java.util.LinkedHashMap; 16 14 import java.util.LinkedHashSet; … … 19 17 import java.util.Map; 20 18 import java.util.Set; 19 import java.util.Stack; 21 20 22 21 import javax.swing.JOptionPane; … … 569 568 } 570 569 571 protected boolean isSpanningWay( Deque<NodePair> way) {570 protected boolean isSpanningWay(Stack<NodePair> way) { 572 571 return numUndirectedEges == way.size(); 573 572 } 574 573 575 protected List<Node> buildPathFromNodePairs( Deque<NodePair> path) {574 protected List<Node> buildPathFromNodePairs(Stack<NodePair> path) { 576 575 List<Node> ret = new LinkedList<>(); 577 576 for (NodePair pair: path) { … … 593 592 if (startNode == null) 594 593 return null; 595 Deque<NodePair> path = new ArrayDeque<>();596 Deque<NodePair> nextPairs = new ArrayDeque<>();594 Stack<NodePair> path = new Stack<>(); 595 Stack<NodePair> nextPairs = new Stack<>(); 597 596 nextPairs.addAll(getOutboundPairs(startNode)); 598 597 while (!nextPairs.isEmpty()) { -
trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
r8851 r8856 8 8 import java.awt.event.KeyEvent; 9 9 import java.io.IOException; 10 import java.util.ArrayDeque;11 10 import java.util.Collection; 12 import java.util.Deque;13 11 import java.util.HashSet; 14 12 import java.util.Set; 13 import java.util.Stack; 15 14 16 15 import javax.swing.JOptionPane; … … 322 321 protected void realRun() throws SAXException, IOException, OsmTransferException { 323 322 try { 324 Deque<OsmPrimitive> toCheck = new ArrayDeque<>();323 Stack<OsmPrimitive> toCheck = new Stack<>(); 325 324 toCheck.addAll(getPrimitivesToCheckForParents()); 326 325 Set<OsmPrimitive> checked = new HashSet<>(); -
trunk/src/org/openstreetmap/josm/actions/upload/CyclicUploadDependencyException.java
r8851 r8856 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.util.ArrayDeque; 7 import java.util.Deque; 6 import java.util.ArrayList; 7 import java.util.List; 8 import java.util.Stack; 8 9 9 10 import org.openstreetmap.josm.data.osm.Relation; 10 11 11 12 public class CyclicUploadDependencyException extends Exception { 12 private final Deque<Relation> cycle;13 private final Stack<Relation> cycle; 13 14 14 public CyclicUploadDependencyException( Deque<Relation> cycle) {15 public CyclicUploadDependencyException(Stack<Relation> cycle) { 15 16 this.cycle = cycle; 16 17 } … … 33 34 sb.append(tr("Cyclic dependency between relations:")) 34 35 .append('['); 35 for ( Relation r : cycle) {36 if ( sb.length()> 0) {36 for (int i = 0; i < cycle.size(); i++) { 37 if (i > 0) { 37 38 sb.append(','); 38 39 } 39 sb.append(formatRelation( r));40 sb.append(formatRelation(cycle.get(i))); 40 41 } 41 42 sb.append(']'); … … 43 44 } 44 45 45 public Deque<Relation> getCyclicUploadDependency() {46 return new Array Deque<>(cycle);46 public List<Relation> getCyclicUploadDependency() { 47 return new ArrayList<>(cycle); 47 48 } 48 49 } -
trunk/src/org/openstreetmap/josm/actions/upload/RelationUploadOrderHook.java
r8851 r8856 6 6 import java.awt.BorderLayout; 7 7 import java.awt.Dimension; 8 import java.util.ArrayList;9 import java.util.Deque;10 8 import java.util.Iterator; 11 9 import java.util.List; … … 69 67 */ 70 68 protected void warnCyclicUploadDependency(CyclicUploadDependencyException e) { 71 Deque<Relation> dep = e.getCyclicUploadDependency();72 Relation last = dep.get Last();69 List<Relation> dep = e.getCyclicUploadDependency(); 70 Relation last = dep.get(dep.size() -1); 73 71 Iterator<Relation> it = dep.iterator(); 74 72 while (it.hasNext()) { … … 79 77 } 80 78 } 81 JPanel pnl = buildWarningPanel( new ArrayList<>(dep));79 JPanel pnl = buildWarningPanel(dep); 82 80 ExtendedDialog dialog = new ExtendedDialog( 83 81 Main.parent, -
trunk/src/org/openstreetmap/josm/data/APIDataSet.java
r8851 r8856 2 2 package org.openstreetmap.josm.data; 3 3 4 import java.util.ArrayDeque;5 4 import java.util.ArrayList; 6 5 import java.util.Collection; 7 6 import java.util.Collections; 8 7 import java.util.Comparator; 9 import java.util.Deque;10 8 import java.util.HashMap; 11 9 import java.util.HashSet; … … 14 12 import java.util.Map; 15 13 import java.util.Set; 14 import java.util.Stack; 16 15 17 16 import org.openstreetmap.josm.actions.upload.CyclicUploadDependencyException; … … 310 309 } 311 310 312 protected void visit( Deque<Relation> path, Relation current) throws CyclicUploadDependencyException {311 protected void visit(Stack<Relation> path, Relation current) throws CyclicUploadDependencyException { 313 312 if (path.contains(current)) { 314 313 path.push(current); … … 329 328 visited = new HashSet<>(); 330 329 uploadOrder = new LinkedList<>(); 331 Deque<Relation> path = new ArrayDeque<>();330 Stack<Relation> path = new Stack<>(); 332 331 for (Relation relation: relations) { 333 332 visit(path, relation); -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r8851 r8856 11 11 import java.nio.charset.StandardCharsets; 12 12 import java.text.NumberFormat; 13 import java.util.ArrayDeque;14 13 import java.util.ArrayList; 15 14 import java.util.Collection; 16 15 import java.util.Collections; 17 16 import java.util.Date; 18 import java.util.Deque;19 17 import java.util.HashSet; 20 18 import java.util.LinkedList; … … 23 21 import java.util.Map.Entry; 24 22 import java.util.Set; 23 import java.util.Stack; 25 24 import java.util.TreeMap; 26 25 import java.util.concurrent.CopyOnWriteArrayList; … … 650 649 } 651 650 652 private Deque<ZoomData> zoomUndoBuffer = new ArrayDeque<>();653 private Deque<ZoomData> zoomRedoBuffer = new ArrayDeque<>();651 private Stack<ZoomData> zoomUndoBuffer = new Stack<>(); 652 private Stack<ZoomData> zoomRedoBuffer = new Stack<>(); 654 653 private Date zoomTimestamp = new Date(); 655 654 -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
r8851 r8856 9 9 import java.awt.event.KeyEvent; 10 10 import java.awt.event.MouseEvent; 11 import java.util.ArrayDeque;12 11 import java.util.ArrayList; 13 12 import java.util.Arrays; 14 13 import java.util.Collection; 15 import java.util.Deque;16 14 import java.util.HashSet; 17 15 import java.util.List; 18 16 import java.util.Set; 17 import java.util.Stack; 19 18 20 19 import javax.swing.AbstractAction; … … 292 291 // Filters can use nested parent/child expression so complete tree is necessary 293 292 Set<OsmPrimitive> result = new HashSet<>(); 294 Deque<OsmPrimitive> stack = new ArrayDeque<>();293 Stack<OsmPrimitive> stack = new Stack<>(); 295 294 stack.addAll(primitives); 296 295 -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r8851 r8856 12 12 import java.io.IOException; 13 13 import java.net.HttpURLConnection; 14 import java.util.ArrayDeque;15 import java.util.Deque;16 14 import java.util.HashSet; 17 15 import java.util.Iterator; 18 16 import java.util.List; 19 17 import java.util.Set; 18 import java.util.Stack; 20 19 21 20 import javax.swing.AbstractAction; … … 330 329 class DownloadAllChildrenTask extends DownloadTask { 331 330 private final Relation relation; 332 private final Deque<Relation> relationsToDownload;331 private final Stack<Relation> relationsToDownload; 333 332 private final Set<Long> downloadedRelationIds; 334 333 … … 336 335 super(tr("Download relation members"), parent); 337 336 this.relation = r; 338 relationsToDownload = new ArrayDeque<>();337 relationsToDownload = new Stack<>(); 339 338 downloadedRelationIds = new HashSet<>(); 340 339 relationsToDownload.push(this.relation); -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r8851 r8856 7 7 import java.io.InputStream; 8 8 import java.io.Reader; 9 import java.util.ArrayDeque;10 9 import java.util.ArrayList; 11 10 import java.util.Collection; 12 import java.util.Deque;13 11 import java.util.HashMap; 14 12 import java.util.LinkedList; 15 13 import java.util.List; 16 14 import java.util.Map; 15 import java.util.Stack; 17 16 18 17 import javax.xml.parsers.ParserConfigurationException; … … 65 64 private GpxLink currentLink; 66 65 private Extensions currentExtensions; 67 private Deque<State> states;68 private final Deque<String> elements = new ArrayDeque<>();66 private Stack<State> states; 67 private final Stack<String> elements = new Stack<>(); 69 68 70 69 private StringBuilder accumulator = new StringBuilder(); … … 75 74 public void startDocument() { 76 75 accumulator = new StringBuilder(); 77 states = new ArrayDeque<>();76 states = new Stack<>(); 78 77 data = new GpxData(); 79 78 } … … 477 476 @Override 478 477 public void endDocument() throws SAXException { 479 if (!states. isEmpty())478 if (!states.empty()) 480 479 throw new SAXException(tr("Parse error: invalid document structure for GPX document.")); 481 480 Extensions metaExt = (Extensions) data.get(META_EXTENSIONS); -
trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
r8851 r8856 4 4 import java.io.IOException; 5 5 import java.io.InputStream; 6 import java.util.ArrayDeque;7 6 import java.util.ArrayList; 8 7 import java.util.Arrays; 9 import java.util.Deque;10 8 import java.util.HashMap; 11 9 import java.util.List; 12 10 import java.util.Map; 13 11 import java.util.Objects; 12 import java.util.Stack; 14 13 15 14 import javax.xml.parsers.ParserConfigurationException; … … 73 72 private StringBuilder accumulator = new StringBuilder(); 74 73 75 private Deque<State> states;74 private Stack<State> states; 76 75 77 76 private List<ImageryInfo> entries; … … 96 95 accumulator = new StringBuilder(); 97 96 skipEntry = false; 98 states = new ArrayDeque<>();97 states = new Stack<>(); 99 98 states.push(State.INIT); 100 99 entries = new ArrayList<>(); -
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r8851 r8856 10 10 import java.lang.reflect.Method; 11 11 import java.lang.reflect.Modifier; 12 import java.util.ArrayDeque;13 import java.util.Deque;14 12 import java.util.HashMap; 15 13 import java.util.Iterator; … … 18 16 import java.util.Locale; 19 17 import java.util.Map; 18 import java.util.Stack; 20 19 21 20 import javax.xml.XMLConstants; … … 65 64 66 65 private class Parser extends DefaultHandler { 67 private Deque<Object> current = new ArrayDeque<>();66 private Stack<Object> current = new Stack<>(); 68 67 private StringBuilder characters = new StringBuilder(64); 69 68
Note:
See TracChangeset
for help on using the changeset viewer.