Changeset 5346 in josm for trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java
- Timestamp:
- 2012-07-17T09:34:34+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java
r5266 r5346 44 44 private ChangesetDataSet data; 45 45 46 // FIXME: this class has many similarities with OsmHistoryReader.Parser and should be merged 46 47 private class Parser extends DefaultHandler { 47 48 … … 103 104 } 104 105 105 protected Double get MandatoryAttributeDouble(Attributes attr, String name) throws SAXException{106 protected Double getAttributeDouble(Attributes attr, String name) throws SAXException{ 106 107 String v = attr.getValue(name); 107 108 if (v == null) { 108 throwException(tr("Missing mandatory attribute ''{0}''.", name));109 return null; 109 110 } 110 111 double d = 0.0; … … 112 113 d = Double.parseDouble(v); 113 114 } catch(NumberFormatException e) { 114 throwException(tr("Illegal value for mandatoryattribute ''{0}'' of type double. Got ''{1}''.", name, v));115 throwException(tr("Illegal value for attribute ''{0}'' of type double. Got ''{1}''.", name, v)); 115 116 } 116 117 return d; … … 160 161 HistoryOsmPrimitive primitive = null; 161 162 if (type.equals(OsmPrimitiveType.NODE)) { 162 double lat = getMandatoryAttributeDouble(atts, "lat"); 163 double lon = getMandatoryAttributeDouble(atts, "lon"); 163 Double lat = getAttributeDouble(atts, "lat"); 164 Double lon = getAttributeDouble(atts, "lon"); 165 LatLon coor = (lat != null && lon != null) ? new LatLon(lat,lon) : null; 164 166 primitive = new HistoryNode( 165 id,version,visible,user,changesetId,timestamp, new LatLon(lat,lon)167 id,version,visible,user,changesetId,timestamp,coor 166 168 ); 167 169
Note:
See TracChangeset
for help on using the changeset viewer.