Ignore:
Timestamp:
2009-03-18T16:13:41+01:00 (15 years ago)
Author:
stoecker
Message:

close #2302 - patch by jttt - optimizations and encapsulation

Location:
trunk/src/org/openstreetmap/josm/io
Files:
2 edited

Legend:

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

    r1494 r1499  
    3333import org.openstreetmap.josm.data.osm.visitor.Visitor;
    3434import org.openstreetmap.josm.gui.PleaseWaitDialog;
     35import org.openstreetmap.josm.tools.DateUtils;
    3536import org.xml.sax.Attributes;
    3637import org.xml.sax.InputSource;
     
    101102               osm.selected = selected;
    102103               osm.deleted = deleted;
    103                osm.timestamp = timestamp;
     104               osm.setTimestamp(getTimestamp());
    104105               osm.user = user;
    105106               osm.visible = visible;
    106107               osm.version = version;
    107                osm.checkTagged();
    108                osm.checkDirectionTagged();
    109108               osm.mappaintStyle = null;
    110109          }
     
    304303          String time = atts.getValue("timestamp");
    305304          if (time != null && time.length() != 0) {
    306                /* Do not parse the date here since it wastes a HUGE amount of time.
    307                 * Moved into OsmPrimitive.
    308                try {
    309                     current.timestamp = DateParser.parse(time);
    310                } catch (ParseException e) {
    311                     e.printStackTrace();
    312                     throw new SAXException(tr("Couldn''t read time format \"{0}\".",time));
    313                }
    314                */
    315                current.timestamp = time;
     305               current.setTimestamp(DateUtils.fromString(time));
    316306          }
    317307
  • trunk/src/org/openstreetmap/josm/io/OsmWriter.java

    r1225 r1499  
    1616import org.openstreetmap.josm.data.osm.Way;
    1717import org.openstreetmap.josm.data.osm.visitor.Visitor;
     18import org.openstreetmap.josm.tools.DateUtils;
    1819
    1920/**
     
    201202                out.print(" action='"+action+"'");
    202203        }
    203         if (osm.timestamp != null) {
    204             out.print(" timestamp='"+osm.timestamp+"'");
     204        if (!osm.isTimestampEmpty()) {
     205            out.print(" timestamp='"+DateUtils.fromDate(osm.getTimestamp())+"'");
    205206        }
    206207        // user and visible added with 0.4 API
Note: See TracChangeset for help on using the changeset viewer.