Ignore:
Timestamp:
2015-10-10T15:47:41+02:00 (9 years ago)
Author:
Don-vip
Message:

sonar - squid:S1149 - Synchronized classes Vector, Hashtable, Stack and StringBuffer should not be used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/upload/CyclicUploadDependencyException.java

    r8510 r8851  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.util.ArrayList;
    7 import java.util.List;
    8 import java.util.Stack;
     6import java.util.ArrayDeque;
     7import java.util.Deque;
    98
    109import org.openstreetmap.josm.data.osm.Relation;
    1110
    1211public class CyclicUploadDependencyException extends Exception {
    13     private final Stack<Relation> cycle;
     12    private final Deque<Relation> cycle;
    1413
    15     public CyclicUploadDependencyException(Stack<Relation> cycle) {
     14    public CyclicUploadDependencyException(Deque<Relation> cycle) {
    1615        this.cycle = cycle;
    1716    }
     
    3433        sb.append(tr("Cyclic dependency between relations:"))
    3534          .append('[');
    36         for (int i = 0; i < cycle.size(); i++) {
    37             if (i > 0) {
     35        for (Relation r : cycle) {
     36            if (sb.length() > 0) {
    3837                sb.append(',');
    3938            }
    40             sb.append(formatRelation(cycle.get(i)));
     39            sb.append(formatRelation(r));
    4140        }
    4241        sb.append(']');
     
    4443    }
    4544
    46     public List<Relation> getCyclicUploadDependency() {
    47         return new ArrayList<>(cycle);
     45    public Deque<Relation> getCyclicUploadDependency() {
     46        return new ArrayDeque<>(cycle);
    4847    }
    4948}
Note: See TracChangeset for help on using the changeset viewer.