Ignore:
Timestamp:
2007-10-11T21:35:15+02:00 (18 years ago)
Author:
framm
Message:
  • alleviated #388 by parsing the timestamps only when they are needed.
File:
1 edited

Legend:

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

    r343 r362  
    88import java.io.InputStreamReader;
    99import java.text.ParseException;
     10import java.util.ArrayList;
    1011import java.util.Arrays;
    1112import java.util.Collection;
     13import java.util.Date;
    1214import java.util.HashMap;
    1315import java.util.HashSet;
     
    150152                                        current = new OsmPrimitiveData();
    151153                                        readCommon(atts, current);
    152                                         ways.put((OsmPrimitiveData)current, new LinkedList<Long>());
     154                                        ways.put((OsmPrimitiveData)current, new ArrayList<Long>());
    153155                                } else if (qName.equals("nd")) {
    154156                                        Collection<Long> list = ways.get(current);
     
    224226                String time = atts.getValue("timestamp");
    225227                if (time != null && time.length() != 0) {
     228                        /* Do not parse the date here since it wastes a HUGE amount of time.
     229                         * Moved into OsmPrimitive.
    226230                        try {
    227231                                current.timestamp = DateParser.parse(time);
     
    230234                                throw new SAXException(tr("Couldn't read time format \"{0}\".",time));
    231235                        }
     236                        */
     237                        current.timestamp = time;
    232238                }
    233239               
     
    290296                        adder.visit(w);
    291297                }
     298               
    292299        }
    293300
     
    393400                throw new SAXException(e1);
    394401        }
    395                 if (pleaseWaitDlg != null) {
     402
     403        if (pleaseWaitDlg != null) {
    396404                        pleaseWaitDlg.progress.setValue(0);
    397405                        pleaseWaitDlg.currentAction.setText(tr("Preparing data..."));
    398406                }
     407
    399408                for (Node n : osm.nodes.values())
    400409                        osm.adder.visit(n);
Note: See TracChangeset for help on using the changeset viewer.