Ignore:
Timestamp:
2023-08-23T00:10:21+02:00 (15 months ago)
Author:
taylor.smock
Message:

Fix tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/GpxParser.java

    r18817 r18818  
    1818
    1919import java.time.DateTimeException;
    20 import java.util.ArrayDeque;
    2120import java.util.ArrayList;
    2221import java.util.Collection;
    23 import java.util.Deque;
    2422import java.util.HashMap;
    2523import java.util.LinkedList;
     
    2725import java.util.Map;
    2826import java.util.Optional;
     27import java.util.Stack;
    2928
    3029import org.openstreetmap.josm.data.Bounds;
     
    7776    private GpxExtensionCollection currentExtensionCollection;
    7877    private GpxExtensionCollection currentTrackExtensionCollection;
    79     private Deque<State> states;
    80     private final Deque<String[]> elements = new ArrayDeque<>();
     78    private final Stack<State> states = new Stack<>();
     79    private final Stack<String[]> elements = new Stack<>();
    8180
    8281    private StringBuilder accumulator = new StringBuilder();
     
    8786    public void startDocument() {
    8887        accumulator = new StringBuilder();
    89         states = new ArrayDeque<>();
    9088        data = new GpxData(true);
    9189        currentExtensionCollection = new GpxExtensionCollection();
     
    402400     */
    403401    private void startElementExt(String namespaceURI, String qName, Attributes attributes) {
    404         if (states.peekLast() == State.TRK) {
     402        if (states.lastElement() == State.TRK) {
    405403            currentTrackExtensionCollection.openChild(namespaceURI, qName, attributes);
    406404        } else {
     
    651649                convertUrlToLink(currentWayPoint.attr);
    652650                currentWayPoint.getExtensions().addAll(currentExtensionCollection);
    653                 if (!currentWayPoint.isLatLonKnown()) {
    654                     currentExtensionCollection.clear();
    655                     throw new SAXException(tr("{0} element does not have valid latitude and/or longitude.", "wpt"));
    656                 }
    657651                data.waypoints.add(currentWayPoint);
    658652                currentExtensionCollection.clear();
     
    723717        } else if (currentExtensionCollection != null) {
    724718            String acc = accumulator.toString().trim();
    725             if (states.peekLast() == State.TRK) {
     719            if (states.lastElement() == State.TRK) {
    726720                currentTrackExtensionCollection.closeChild(qName, acc); //a segment inside the track can have an extension too
    727721            } else {
Note: See TracChangeset for help on using the changeset viewer.