Index: trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java	(revision 8855)
+++ trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java	(revision 8856)
@@ -8,9 +8,7 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
-import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Deque;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
@@ -19,4 +17,5 @@
 import java.util.Map;
 import java.util.Set;
+import java.util.Stack;
 
 import javax.swing.JOptionPane;
@@ -569,9 +568,9 @@
         }
 
-        protected boolean isSpanningWay(Deque<NodePair> way) {
+        protected boolean isSpanningWay(Stack<NodePair> way) {
             return numUndirectedEges == way.size();
         }
 
-        protected List<Node> buildPathFromNodePairs(Deque<NodePair> path) {
+        protected List<Node> buildPathFromNodePairs(Stack<NodePair> path) {
             List<Node> ret = new LinkedList<>();
             for (NodePair pair: path) {
@@ -593,6 +592,6 @@
             if (startNode == null)
                 return null;
-            Deque<NodePair> path = new ArrayDeque<>();
-            Deque<NodePair> nextPairs  = new ArrayDeque<>();
+            Stack<NodePair> path = new Stack<>();
+            Stack<NodePair> nextPairs  = new Stack<>();
             nextPairs.addAll(getOutboundPairs(startNode));
             while (!nextPairs.isEmpty()) {
Index: trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java	(revision 8855)
+++ trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java	(revision 8856)
@@ -8,9 +8,8 @@
 import java.awt.event.KeyEvent;
 import java.io.IOException;
-import java.util.ArrayDeque;
 import java.util.Collection;
-import java.util.Deque;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.Stack;
 
 import javax.swing.JOptionPane;
@@ -322,5 +321,5 @@
         protected void realRun() throws SAXException, IOException, OsmTransferException {
             try {
-                Deque<OsmPrimitive> toCheck = new ArrayDeque<>();
+                Stack<OsmPrimitive> toCheck = new Stack<>();
                 toCheck.addAll(getPrimitivesToCheckForParents());
                 Set<OsmPrimitive> checked = new HashSet<>();
Index: trunk/src/org/openstreetmap/josm/actions/upload/CyclicUploadDependencyException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/upload/CyclicUploadDependencyException.java	(revision 8855)
+++ trunk/src/org/openstreetmap/josm/actions/upload/CyclicUploadDependencyException.java	(revision 8856)
@@ -4,13 +4,14 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.util.ArrayDeque;
-import java.util.Deque;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Stack;
 
 import org.openstreetmap.josm.data.osm.Relation;
 
 public class CyclicUploadDependencyException extends Exception {
-    private final Deque<Relation> cycle;
+    private final Stack<Relation> cycle;
 
-    public CyclicUploadDependencyException(Deque<Relation> cycle) {
+    public CyclicUploadDependencyException(Stack<Relation> cycle) {
         this.cycle = cycle;
     }
@@ -33,9 +34,9 @@
         sb.append(tr("Cyclic dependency between relations:"))
           .append('[');
-        for (Relation r : cycle) {
-            if (sb.length() > 0) {
+        for (int i = 0; i < cycle.size(); i++) {
+            if (i > 0) {
                 sb.append(',');
             }
-            sb.append(formatRelation(r));
+            sb.append(formatRelation(cycle.get(i)));
         }
         sb.append(']');
@@ -43,6 +44,6 @@
     }
 
-    public Deque<Relation> getCyclicUploadDependency() {
-        return new ArrayDeque<>(cycle);
+    public List<Relation> getCyclicUploadDependency() {
+        return new ArrayList<>(cycle);
     }
 }
Index: trunk/src/org/openstreetmap/josm/actions/upload/RelationUploadOrderHook.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/upload/RelationUploadOrderHook.java	(revision 8855)
+++ trunk/src/org/openstreetmap/josm/actions/upload/RelationUploadOrderHook.java	(revision 8856)
@@ -6,6 +6,4 @@
 import java.awt.BorderLayout;
 import java.awt.Dimension;
-import java.util.ArrayList;
-import java.util.Deque;
 import java.util.Iterator;
 import java.util.List;
@@ -69,6 +67,6 @@
      */
     protected void warnCyclicUploadDependency(CyclicUploadDependencyException e) {
-        Deque<Relation> dep = e.getCyclicUploadDependency();
-        Relation last = dep.getLast();
+        List<Relation> dep = e.getCyclicUploadDependency();
+        Relation last = dep.get(dep.size() -1);
         Iterator<Relation> it = dep.iterator();
         while (it.hasNext()) {
@@ -79,5 +77,5 @@
             }
         }
-        JPanel pnl = buildWarningPanel(new ArrayList<>(dep));
+        JPanel pnl = buildWarningPanel(dep);
         ExtendedDialog dialog = new ExtendedDialog(
                 Main.parent,
