Changeset 2181 in josm for trunk/src/org/openstreetmap/josm/io/OsmReader.java
- Timestamp:
- 2009-09-22T15:34:19+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r2155 r2181 172 172 if (qName.equals("osm")) { 173 173 if (atts == null) { 174 throwException(tr("Missing mandatory attribute ''{0}'' of XML element {1} ", "version", "osm"));174 throwException(tr("Missing mandatory attribute ''{0}'' of XML element {1}.", "version", "osm")); 175 175 } 176 176 String v = atts.getValue("version"); 177 177 if (v == null) { 178 throwException(tr("Missing mandatory attribute ''{0}'' ", "version"));178 throwException(tr("Missing mandatory attribute ''{0}''.", "version")); 179 179 } 180 180 if (!(v.equals("0.5") || v.equals("0.6"))) { … … 203 203 } else { 204 204 throwException(tr( 205 "Missing manadatory attributes on element ''bounds''. Got minlon=''{0}'',minlat=''{1}00,maxlon=''{3}'',maxlat=''{4}'', origin=''{5}'' ",205 "Missing manadatory attributes on element ''bounds''. Got minlon=''{0}'',minlat=''{1}00,maxlon=''{3}'',maxlat=''{4}'', origin=''{5}''.", 206 206 minlon, minlat, maxlon, maxlat, origin 207 207 )); … … 226 226 if (list == null) { 227 227 throwException( 228 tr(" found XML element <nd> element not as direct child of element <way>")228 tr("Found XML element <nd> not as direct child of element <way>.") 229 229 ); 230 230 } 231 231 if (atts.getValue("ref") == null) { 232 232 throwException( 233 tr("Missing mandatory attribute ''{0}'' on <nd> of way {1} ", "ref", current.id)233 tr("Missing mandatory attribute ''{0}'' on <nd> of way {1}.", "ref", current.id) 234 234 ); 235 235 } … … 237 237 if (id == 0) { 238 238 throwException( 239 tr("Illegal value of attribute ''ref'' of element <nd>. Got {0} ", id)239 tr("Illegal value of attribute ''ref'' of element <nd>. Got {0}.", id) 240 240 ); 241 241 } … … 254 254 if (list == null) { 255 255 throwException( 256 tr("Found XML element <member> not as direct child of element <relation> ")256 tr("Found XML element <member> not as direct child of element <relation>.") 257 257 ); 258 258 } … … 260 260 String value = atts.getValue("ref"); 261 261 if (value == null) { 262 throwException(tr("Missing attribute ''ref'' on member in relation {0} ",current.id));262 throwException(tr("Missing attribute ''ref'' on member in relation {0}.",current.id)); 263 263 } 264 264 try { … … 269 269 value = atts.getValue("type"); 270 270 if (value == null) { 271 throwException(tr("Missing attribute ''type'' on member {0} in relation {1} ", Long.toString(emd.id), Long.toString(current.id)));271 throwException(tr("Missing attribute ''type'' on member {0} in relation {1}.", Long.toString(emd.id), Long.toString(current.id))); 272 272 } 273 273 if (! (value.equals("way") || value.equals("node") || value.equals("relation"))) { … … 309 309 return User.createOsmUser(id, name); 310 310 } catch(NumberFormatException e) { 311 throwException(tr("Illegal value for attribute ''uid''. Got ''{0}'' ", uid));311 throwException(tr("Illegal value for attribute ''uid''. Got ''{0}''.", uid)); 312 312 } 313 313 return null; … … 319 319 current.id = getLong(atts, "id"); 320 320 if (current.id == 0) { 321 throwException(tr("Illegal object with id=0"));321 throwException(tr("Illegal object with ID=0.")); 322 322 } 323 323 … … 345 345 current.version = Integer.parseInt(version); 346 346 } catch(NumberFormatException e) { 347 throwException(tr("Illegal value for attribute ''version'' on OSM primitive with id {0}. Got {1}", Long.toString(current.id), version));347 throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.id), version)); 348 348 } 349 349 if (ds.version.equals("0.6")){ 350 350 if (current.version <= 0 && current.id > 0) { 351 throwException(tr("Illegal value for attribute ''version'' on OSM primitive with id {0}. Got {1}", Long.toString(current.id), version));351 throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.id), version)); 352 352 } else if (current.version < 0 && current.id <=0) { 353 System.out.println(tr("WARNING: normalizing value of attribute ''version'' of element {0} to 0, API version is ''0.6''. Got {1}", current.id, current.version));353 System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 0, "0.6")); 354 354 current.version = 0; 355 355 } 356 356 } else if (ds.version.equals("0.5")) { 357 357 if (current.version <= 0 && current.id > 0) { 358 System.out.println(tr("WARNING: normalizing value of attribute ''version'' of element {0} to 1, API version is ''0.5''. Got {1}", current.id, current.version));358 System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 1, "0.5")); 359 359 current.version = 1; 360 360 } else if (current.version < 0 && current.id <=0) { 361 System.out.println(tr("WARNING: normalizing value of attribute ''version'' of element {0} to 0, API version is ''0.5''. Got {1}", current.id, current.version));361 System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 0, "0.5")); 362 362 current.version = 0; 363 363 } 364 364 } else { 365 365 // should not happen. API version has been checked before 366 throwException(tr("Unknown or unsupported API version. Got {0} ", ds.version));366 throwException(tr("Unknown or unsupported API version. Got {0}.", ds.version)); 367 367 } 368 368 } else { … … 370 370 // 371 371 if (current.id > 0 && ds.version != null && ds.version.equals("0.6")) { 372 throwException(tr("Missing attribute ''version'' on OSM primitive with id {0}", Long.toString(current.id)));372 throwException(tr("Missing attribute ''version'' on OSM primitive with ID {0}.", Long.toString(current.id))); 373 373 } 374 374 } … … 392 392 return Long.parseLong(value); 393 393 } catch(NumberFormatException e) { 394 throwException(tr("Illegal long value for attribute ''{0}''. Got ''{1}'' ",name, value));394 throwException(tr("Illegal long value for attribute ''{0}''. Got ''{1}''.",name, value)); 395 395 } 396 396 return 0; // should not happen … … 416 416 throw new IllegalDataException ( 417 417 tr( 418 " way with external id ''{0}'' includes missing node with external id ''{1}''",418 "Way with external ID ''{0}'' includes missing node with external ID ''{1}''.", 419 419 externalWayId, 420 420 id … … 429 429 w.setNodes(wayNodes); 430 430 if (incomplete) { 431 logger.warning(tr(" marked way {0} with {1} nodes incomplete because at least one node was missing in the " +432 "loaded data and is therefore incomplete too ", externalWayId, w.getNodesCount()));431 logger.warning(tr("Marked way {0} with {1} nodes incomplete because at least one node was missing in the " + 432 "loaded data and is therefore incomplete too.", externalWayId, w.getNodesCount())); 433 433 w.incomplete = true; 434 434 ds.addPrimitive(w); … … 477 477 } else 478 478 throw new IllegalDataException( 479 tr("Unknown relation member type ''{0}'' in relation with external id ''{1}'' ", rm.type,externalRelationId)479 tr("Unknown relation member type ''{0}'' in relation with external id ''{1}''.", rm.type,externalRelationId) 480 480 ); 481 481 … … 488 488 throw new IllegalDataException( 489 489 tr( 490 "Relation with external id ''{0}'' refers to missing primitive with external id ''{1}'' ",490 "Relation with external id ''{0}'' refers to missing primitive with external id ''{1}''.", 491 491 externalRelationId, 492 492 rm.id
Note:
See TracChangeset
for help on using the changeset viewer.