Ignore:
Timestamp:
2010-02-12T22:33:49+01:00 (15 years ago)
Author:
roland
Message:

Backport to Java 1.5 without loss of functionality; minor bugfix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/public_transport/src/public_transport/RoutePatternAction.java

    r19977 r19983  
    1616import java.util.LinkedList;
    1717import java.util.List;
     18import java.util.ListIterator;
    1819import java.util.Map;
    1920import java.util.TreeMap;
     
    8182      if (route.get("route") != null)
    8283      {
     84        if (rr.route.get("route") == null)
     85          return -1;
    8386        int result = route.get("route").compareTo(rr.route.get("route"));
    8487        if (result != 0)
     
    8992      if (route.get("ref") != null)
    9093      {
     94        if (rr.route.get("ref") == null)
     95          return -1;
    9196        int result = route.get("ref").compareTo(rr.route.get("ref"));
    9297        if (result != 0)
     
    97102      if (route.get("to") != null)
    98103      {
     104        if (rr.route.get("to") == null)
     105          return -1;
    99106        int result = route.get("to").compareTo(rr.route.get("to"));
    100107        if (result != 0)
     
    105112      if (route.get("direction") != null)
    106113      {
     114        if (rr.route.get("direction") == null)
     115          return -1;
    107116        int result = route.get("direction").compareTo(rr.route.get("direction"));
    108117        if (result != 0)
     
    18451854        frontNodes.remove(firstListNode);
    18461855        LinkedList<RelationMember> listToAppend = frontNodes.get(lastNode);
    1847         Iterator<RelationMember> memberIter = list.descendingIterator();
    1848         while (memberIter.hasNext())
    1849         {
    1850           RelationMember member = memberIter.next();
     1856        ListIterator<RelationMember> memberIter = list.listIterator(list.size());
     1857        while (memberIter.hasPrevious())
     1858        {
     1859          RelationMember member = memberIter.previous();
    18511860          listToAppend.addFirst(member);
    18521861        }
     
    18581867        frontNodes.remove(firstListNode);
    18591868        LinkedList<RelationMember> listToAppend = backNodes.get(lastNode);
    1860         Iterator<RelationMember> memberIter = list.descendingIterator();
    1861         while (memberIter.hasNext())
    1862         {
    1863           RelationMember member = memberIter.next();
     1869        ListIterator<RelationMember> memberIter = list.listIterator(list.size());
     1870        while (memberIter.hasPrevious())
     1871        {
     1872          RelationMember member = memberIter.previous();
    18641873          if ("backward".equals(member.getRole()))
    18651874            listToAppend.addLast(new RelationMember("forward", member.getWay()));
Note: See TracChangeset for help on using the changeset viewer.