Changeset 2181 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2009-09-22T15:34:19+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r1879 r2181 72 72 if (cancel) 73 73 return null; 74 throw new SAXException("Illegal characters within the HTTP-header response", e); 74 throw new SAXException("Illegal characters within the HTTP-header response.", e); 75 75 } catch (IOException e) { 76 76 if (cancel) -
trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java
r2115 r2181 23 23 public ChangesetQuery forUser(long uid) { 24 24 if (uid <= 0) 25 throw new IllegalArgumentException(tr(" parameter ''{0}'' > 0 expected. Got{1}", "uid", uid));25 throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected. Got ''{1}''.", "uid", uid)); 26 26 this.user = uid; 27 27 return this; -
trunk/src/org/openstreetmap/josm/io/FileExporter.java
r1949 r2181 22 22 23 23 public void exportData(File file, Layer layer) throws IOException { 24 throw new IOException(tr("Could not export \"{0}\"", file.getName()));24 throw new IOException(tr("Could not export ''{0}''.", file.getName())); 25 25 } 26 26 } -
trunk/src/org/openstreetmap/josm/io/FileImporter.java
r2070 r2181 22 22 23 23 public void importData(File file) throws IOException, IllegalDataException { 24 throw new IOException(tr("Could not read \"{0}\"", file.getName()));24 throw new IOException(tr("Could not read ''{0}''.", file.getName())); 25 25 } 26 26 -
trunk/src/org/openstreetmap/josm/io/GpxExporter.java
r2163 r2181 53 53 public void exportData(File file, Layer layer) throws IOException { 54 54 if (layer == null) 55 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));55 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 56 56 if (!(layer instanceof OsmDataLayer) && !(layer instanceof GpxLayer)) 57 throw new IllegalArgumentException(tr(" expected instance of OsmDataLayer or GpxLayer. Got ''{0}''.", layer57 throw new IllegalArgumentException(tr("Expected instance of OsmDataLayer or GpxLayer. Got ''{0}''.", layer 58 58 .getClass().getName())); 59 59 if (file == null) 60 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "file"));60 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "file")); 61 61 62 62 String fn = file.getPath(); … … 69 69 JPanel p = new JPanel(new GridBagLayout()); 70 70 71 p.add(new JLabel(tr(" gpstrack description")), GBC.eol());71 p.add(new JLabel(tr("GPS track description")), GBC.eol()); 72 72 JTextArea desc = new JTextArea(3, 40); 73 73 desc.setWrapStyleWord(true); -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r2151 r2181 308 308 @Override public void endDocument() throws SAXException { 309 309 if (!states.empty()) { 310 throw new SAXException(tr("Parse error: invalid document structure for gpxdocument"));310 throw new SAXException(tr("Parse error: invalid document structure for GPX document.")); 311 311 } 312 312 data = currentData; -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r2077 r2181 112 112 protected void remember(DataSet ds, long id, OsmPrimitiveType type) throws IllegalArgumentException, NoSuchElementException{ 113 113 if (ds == null) 114 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "ds"));114 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "ds")); 115 115 if (id <= 0) return; 116 116 OsmPrimitive primitive = ds.getPrimitiveById(id, type); 117 117 if (primitive == null) 118 throw new NoSuchElementException(tr(" no primitive with id {0} in local dataset. Can't infer primitive type", id));118 throw new NoSuchElementException(tr("No primitive with id {0} in local dataset. Can't infer primitive type.", id)); 119 119 remember(id, OsmPrimitiveType.from(primitive)); 120 120 return; … … 414 414 } catch(OsmApiException e) { 415 415 if (e.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) { 416 logger.warning(tr("Server replied with response code 404, retrying with an individual request for each primitive")); 416 logger.warning(tr("Server replied with response code 404, retrying with an individual request for each primitive.")); 417 417 singleGetIdPackage(type, pkg, progressMonitor); 418 418 } else -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r2171 r2181 80 80 String serverUrl = Main.pref.get("osm-server.url", "http://api.openstreetmap.org/api"); 81 81 if (serverUrl == null) 82 throw new IllegalStateException(tr(" preference ''{0}'' missing. Can't initialize OsmApi", "osm-server.url"));82 throw new IllegalStateException(tr("Preference ''{0}'' missing. Can't initialize OsmApi.", "osm-server.url")); 83 83 return getOsmApi(serverUrl); 84 84 } … … 132 132 protected OsmApi(String serverUrl) { 133 133 if (serverUrl == null) 134 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "serverUrl"));134 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "serverUrl")); 135 135 this.serverUrl = serverUrl; 136 136 } … … 176 176 initialized = false; 177 177 } 178 System.out.println(tr("Communications with {0} established using protocol version {1}", 178 System.out.println(tr("Communications with {0} established using protocol version {1}.", 179 179 serverUrl, 180 180 version)); … … 251 251 osm.setOsmId(Long.parseLong(ret.trim()), 1); 252 252 } catch(NumberFormatException e){ 253 throw new OsmTransferException(tr(" unexpected format ofidreplied by the server, got ''{0}''", ret));253 throw new OsmTransferException(tr("Unexpected format of ID replied by the server. Got ''{0}''.", ret)); 254 254 } 255 255 } … … 277 277 } 278 278 } catch(NumberFormatException e) { 279 throw new OsmTransferException(tr(" unexpected format of new version of modified primitive ''{0}'', got ''{1}''", osm.getId(), ret));279 throw new OsmTransferException(tr("Unexpected format of new version of modified primitive ''{0}''. Got ''{1}''.", osm.getId(), ret)); 280 280 } 281 281 } … … 311 311 public void openChangeset(Changeset changeset, ProgressMonitor progressMonitor) throws OsmTransferException { 312 312 if (changeset == null) 313 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "changeset"));313 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "changeset")); 314 314 try { 315 315 progressMonitor.beginTask((tr("Creating changeset..."))); … … 321 321 changeset.setOpen(true); 322 322 } catch(NumberFormatException e){ 323 throw new OsmTransferException(tr(" unexpected format ofidreplied by the server, got ''{0}''", ret));323 throw new OsmTransferException(tr("Unexpected format of ID replied by the server. Got ''{0}''.", ret)); 324 324 } 325 325 progressMonitor.setCustomText((tr("Successfully opened changeset {0}",changeset.getId()))); … … 343 343 public void updateChangeset(Changeset changeset, ProgressMonitor monitor) throws OsmTransferException { 344 344 if (changeset == null) 345 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "changeset"));345 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "changeset")); 346 346 if (monitor == null) { 347 347 monitor = NullProgressMonitor.INSTANCE; 348 348 } 349 349 if (changeset.getId() <= 0) 350 throw new IllegalArgumentException(tr(" id of changeset> 0 required. Got {0}", changeset.getId()));350 throw new IllegalArgumentException(tr("Changeset ID > 0 expected. Got {0}.", changeset.getId())); 351 351 try { 352 352 monitor.beginTask(tr("Updating changeset...")); … … 378 378 public void closeChangeset(Changeset changeset, ProgressMonitor monitor) throws OsmTransferException { 379 379 if (changeset == null) 380 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "changeset"));380 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "changeset")); 381 381 if (monitor == null) { 382 382 monitor = NullProgressMonitor.INSTANCE; 383 383 } 384 384 if (changeset.getId() <= 0) 385 throw new IllegalArgumentException(tr(" id of changeset> 0 required. Got {0}", changeset.getId()));385 throw new IllegalArgumentException(tr("Changeset ID > 0 expected. Got {0}.", changeset.getId())); 386 386 try { 387 387 monitor.beginTask(tr("Closing changeset...")); … … 405 405 progressMonitor.beginTask("", list.size() * 2); 406 406 if (changeset == null) 407 throw new OsmTransferException(tr("No changeset present for diff upload")); 407 throw new OsmTransferException(tr("No changeset present for diff upload.")); 408 408 409 409 initialize(progressMonitor); … … 596 596 throw new OsmTransferException(tr("Current changeset is null. Can't upload data.")); 597 597 if (changeset.getId() <= 0) 598 throw new OsmTransferException(tr(" idof current changeset > 0 required. Currentidis {0}", changeset.getId()));598 throw new OsmTransferException(tr("ID of current changeset > 0 required. Current ID is {0}.", changeset.getId())); 599 599 } 600 600 /** … … 622 622 } 623 623 if (changeset.getId() <= 0) 624 throw new IllegalArgumentException(tr("Changeset id> 0 expected. Got {0}", changeset.getId()));624 throw new IllegalArgumentException(tr("Changeset ID > 0 expected. Got {0}.", changeset.getId())); 625 625 if (!changeset.isOpen()) 626 throw new IllegalArgumentException(tr("Open changeset expected. Got closed changeset with id {0}", changeset.getId())); 626 throw new IllegalArgumentException(tr("Open changeset expected. Got closed changeset with id {0}.", changeset.getId())); 627 627 this.changeset = changeset; 628 628 } -
trunk/src/org/openstreetmap/josm/io/OsmApiException.java
r1874 r2181 91 91 sb.append(tr("(Code={0})", responseCode)); 92 92 } else { 93 sb.append(tr("The server replied an error with code {0}", responseCode)); 93 sb.append(tr("The server replied an error with code {0}.", responseCode)); 94 94 } 95 95 return sb.toString(); -
trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
r2115 r2181 70 70 String value = atts.getValue("id"); 71 71 if (value == null) { 72 throwException(tr(" missing mandatory attribute ''{0}''", "id"));72 throwException(tr("Missing mandatory attribute ''{0}''.", "id")); 73 73 } 74 74 long id = 0; … … 76 76 id = Long.parseLong(value); 77 77 } catch(NumberFormatException e) { 78 throwException(tr(" illegal value for attribute ''{0}''. Got ''{1}''", "id", value));78 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "id", value)); 79 79 } 80 80 if (id <= 0) { 81 throwException(tr(" illegal nummeric value for attribute ''{0}''. Got ''{1}''", "id", id));81 throwException(tr("Illegal nummeric value for attribute ''{0}''. Got ''{1}''.", "id", id)); 82 82 } 83 83 current.setId(id); … … 107 107 value = atts.getValue("open"); 108 108 if (value == null) { 109 throwException(tr(" missing mandatory attribute ''{0}''", "open"));109 throwException(tr("Missing mandatory attribute ''{0}''.", "open")); 110 110 } else if (value.equals("true")) { 111 111 current.setOpen(true); … … 113 113 current.setOpen(false); 114 114 } else { 115 throwException(tr(" illegal boolean value for attribute ''{0}''. Got ''{1}''", "open", value));115 throwException(tr("Illegal boolean value for attribute ''{0}''. Got ''{1}''.", "open", value)); 116 116 } 117 117 … … 126 126 minLon = Double.parseDouble(min_lon); 127 127 } catch(NumberFormatException e) { 128 throwException(tr(" illegal value for attribute ''{0}''. Got ''{1}''", "min_lon", min_lon));128 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "min_lon", min_lon)); 129 129 } 130 130 double minLat = 0; … … 132 132 minLat = Double.parseDouble(min_lat); 133 133 } catch(NumberFormatException e) { 134 throwException(tr(" illegal value for attribute ''{0}''. Got ''{1}''", "min_lat", min_lat));134 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "min_lat", min_lat)); 135 135 } 136 136 current.setMin(new LatLon(minLat, minLon)); … … 142 142 maxLon = Double.parseDouble(max_lon); 143 143 } catch(NumberFormatException e) { 144 throwException(tr(" illegal value for attribute ''{0}''. Got ''{1}''", "max_lon", max_lon));144 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "max_lon", max_lon)); 145 145 } 146 146 double maxLat = 0; … … 148 148 maxLat = Double.parseDouble(max_lat); 149 149 } catch(NumberFormatException e) { 150 throwException(tr(" illegal value for attribute ''{0}''. Got ''{1}''", "max_lat", max_lat));150 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "max_lat", max_lat)); 151 151 } 152 152 current.setMax(new LatLon(maxLon, maxLat)); … … 157 157 if (qName.equals("osm")) { 158 158 if (atts == null) { 159 throwException(tr("Missing mandatory attribute ''{0}'' of XML element {1}", "version", "osm")); 159 throwException(tr("Missing mandatory attribute ''{0}'' of XML element {1}.", "version", "osm")); 160 160 } 161 161 String v = atts.getValue("version"); 162 162 if (v == null) { 163 throwException(tr("Missing mandatory attribute ''{0}''", "version")); 163 throwException(tr("Missing mandatory attribute ''{0}''.", "version")); 164 164 } 165 165 if (!(v.equals("0.6"))) { … … 195 195 return User.createOsmUser(id, name); 196 196 } catch(NumberFormatException e) { 197 throwException(tr("Illegal value for attribute ''uid''. Got ''{0}''", uid)); 197 throwException(tr("Illegal value for attribute ''uid''. Got ''{0}''.", uid)); 198 198 } 199 199 return null; -
trunk/src/org/openstreetmap/josm/io/OsmExporter.java
r2025 r2181 81 81 JOptionPane.showMessageDialog( 82 82 Main.parent, 83 tr("<html>An error occurred while saving.<br>Error is: 83 tr("<html>An error occurred while saving.<br>Error is:<br>{0}</html>", e.getMessage()), 84 84 tr("Error"), 85 85 JOptionPane.ERROR_MESSAGE … … 96 96 JOptionPane.showMessageDialog( 97 97 Main.parent, 98 tr("<html>An error occurred while restoring backup file.<br>Error is: 98 tr("<html>An error occurred while restoring backup file.<br>Error is:<br>{0}</html>", e2.getMessage()), 99 99 tr("Error"), 100 100 JOptionPane.ERROR_MESSAGE -
trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java
r1811 r2181 66 66 String v = attr.getValue(name); 67 67 if (v == null) { 68 throwException(tr("mandatory attribute ''{0}'' missing", name));68 throwException(tr("Missing mandatory attribute ''{0}''.", name)); 69 69 } 70 70 Long l = 0l; … … 72 72 l = Long.parseLong(v); 73 73 } catch(NumberFormatException e) { 74 throwException(tr(" illegal value for mandatory attribute ''{0}'' of type long, got ''{1}''", name, v));74 throwException(tr("Illegal value for mandatory attribute ''{0}'' of type long. Got ''{1}''.", name, v)); 75 75 } 76 76 if (l < 0) { 77 throwException(tr(" illegal value for mandatory attribute ''{0}'' of type long (>=0), got ''{1}''", name, v));77 throwException(tr("Illegal value for mandatory attribute ''{0}'' of type long (>=0). Got ''{1}''.", name, v)); 78 78 } 79 79 return l; … … 83 83 String v = attr.getValue(name); 84 84 if (v == null) { 85 throwException(tr("mandatory attribute ''{0}'' missing", name));85 throwException(tr("Missing mandatory attribute ''{0}''.", name)); 86 86 } 87 87 Integer i = 0; … … 89 89 i = Integer.parseInt(v); 90 90 } catch(NumberFormatException e) { 91 throwException(tr(" illegal value for mandatory attribute ''{0}'' of type int, got ''{1}''", name, v));91 throwException(tr("Illegal value for mandatory attribute ''{0}'' of type int. Got ''{1}''.", name, v)); 92 92 } 93 93 if (i < 0) { 94 throwException(tr(" illegal value for mandatory attribute ''{0}'' of type int (>=0), got ''{1}''", name, v));94 throwException(tr("Illegal value for mandatory attribute ''{0}'' of type int (>=0). Got ''{1}''.", name, v)); 95 95 } 96 96 return i; … … 100 100 String v = attr.getValue(name); 101 101 if (v == null) { 102 throwException(tr("mandatory attribute ''{0}'' missing", name));102 throwException(tr("Missing mandatory attribute ''{0}''.", name)); 103 103 } 104 104 return v; … … 108 108 String v = attr.getValue(name); 109 109 if (v == null) { 110 throwException(tr("mandatory attribute ''{0}'' missing", name));110 throwException(tr("Missing mandatory attribute ''{0}''.", name)); 111 111 } 112 112 if (v.equals("true")) return true; 113 113 if (v.equals("false")) return false; 114 throwException(tr(" illegal value for mandatory attribute ''{0}'' of type boolean, got ''{1}''", name, v));114 throwException(tr("Illegal value for mandatory attribute ''{0}'' of type boolean. Got ''{1}''.", name, v)); 115 115 // not reached 116 116 return false; … … 172 172 type = OsmPrimitiveType.fromApiTypeName(v); 173 173 } catch(IllegalArgumentException e) { 174 throwException(tr(" illegal value for mandatory attribute ''{0}'' of type OsmPrimitiveType, got ''{1}''", "type", v));174 throwException(tr("Illegal value for mandatory attribute ''{0}'' of type OsmPrimitiveType. Got ''{1}''.", "type", v)); 175 175 } 176 176 String role = getMandatoryAttributeString(atts, "role"); -
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r2070 r2181 34 34 } catch (FileNotFoundException e) { 35 35 e.printStackTrace(); 36 throw new IOException(tr("File \"{0}\"does not exist", file.getName()));36 throw new IOException(tr("File ''{0}'' does not exist.", file.getName())); 37 37 } 38 38 } -
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>elementnot 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} to0, 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} to1, 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} to0, 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 externalid''{0}'' includes missing node with externalid''{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 -
trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java
r2070 r2181 50 50 public OsmServerBackreferenceReader(OsmPrimitive primitive) throws IllegalArgumentException { 51 51 if (primitive == null) 52 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "primitive"));52 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitive")); 53 53 if (primitive.getId() == 0) 54 throw new IllegalArgumentException(tr(" idparameter ''{0}'' > 0required. Got{1}", "primitive", primitive.getId()));54 throw new IllegalArgumentException(tr("ID parameter ''{0}'' > 0 expected. Got ''{1}''.", "primitive", primitive.getId())); 55 55 this.id = primitive.getId(); 56 56 this.primitiveType = OsmPrimitiveType.from(primitive); … … 70 70 public OsmServerBackreferenceReader(long id, OsmPrimitiveType type) throws IllegalArgumentException { 71 71 if (id <= 0) 72 throw new IllegalArgumentException(tr(" parameter ''{0}'' > 0required. Got{1}", "id", id));72 throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected. Got ''{1}''.", "id", id)); 73 73 if (type == null) 74 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "type"));74 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "type")); 75 75 this.id = id; 76 76 this.primitiveType = type; -
trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java
r2124 r2181 44 44 public List<Changeset> queryChangesets(ChangesetQuery query, ProgressMonitor monitor) throws OsmTransferException { 45 45 if (query == null) 46 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "query"));46 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "query")); 47 47 if (monitor == null) { 48 48 monitor = NullProgressMonitor.INSTANCE; … … 78 78 public Changeset readChangeset(long id, ProgressMonitor monitor) throws OsmTransferException { 79 79 if (id <= 0) 80 throw new IllegalArgumentException(tr(" parameter ''{0}'' > 0 expected. Got{1}", "id", id));80 throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected. Got ''{1}''.", "id", id)); 81 81 if (monitor == null) { 82 82 monitor = NullProgressMonitor.INSTANCE; -
trunk/src/org/openstreetmap/josm/io/OsmServerHistoryReader.java
r1892 r2181 31 31 public OsmServerHistoryReader(OsmPrimitiveType type, long id) throws IllegalArgumentException { 32 32 if (type == null) 33 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "type"));33 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "type")); 34 34 if (id < 0) 35 throw new IllegalArgumentException(tr(" parameter ''{0}'' >= 0 expected, got ''{1}''", "id", id));35 throw new IllegalArgumentException(tr("Parameter ''{0}'' >= 0 expected. Got ''{1}''.", "id", id)); 36 36 this.primitiveType = type; 37 37 this.id = id; -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r2124 r2181 61 61 activeConnection = (HttpURLConnection)url.openConnection(); 62 62 } catch(Exception e) { 63 throw new OsmTransferException(tr("Failed to open connection to API {0}", url.toExternalForm()), e); 63 throw new OsmTransferException(tr("Failed to open connection to API {0}.", url.toExternalForm()), e); 64 64 } 65 65 if (cancel) { … … 86 86 activeConnection.connect(); 87 87 } catch (Exception e) { 88 throw new OsmTransferException(tr("Couldn't connect to the osmserver. Please check your internet connection."), e);88 throw new OsmTransferException(tr("Couldn't connect to the OSM server. Please check your internet connection."), e); 89 89 } 90 90 try { -
trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java
r2124 r2181 46 46 Node xmlNode = (Node)xpath.compile("/osm/user[1]").evaluate(document, XPathConstants.NODE); 47 47 if ( xmlNode== null) 48 throw new OsmDataParsingException(tr("XML tag <user> is missing")); 48 throw new OsmDataParsingException(tr("XML tag <user> is missing.")); 49 49 50 50 // -- id 51 51 String v = getAttribute(xmlNode, "id"); 52 52 if (v == null) 53 throw new OsmDataParsingException(tr("Missing attribute ''{0}'' on XML tag ''{1}''", "id", "user")); 53 throw new OsmDataParsingException(tr("Missing attribute ''{0}'' on XML tag ''{1}''.", "id", "user")); 54 54 try { 55 55 userInfo.setId(Long.parseLong(v)); 56 56 } catch(NumberFormatException e) { 57 throw new OsmDataParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}", "id", "user", v)); 57 throw new OsmDataParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "id", "user", v)); 58 58 } 59 59 // -- display name … … 75 75 v = getAttribute(xmlNode, "lat"); 76 76 if (v == null) 77 throw new OsmDataParsingException(tr("Missing attribute ''{0}'' on XML tag ''{1}''", "lat", "home")); 77 throw new OsmDataParsingException(tr("Missing attribute ''{0}'' on XML tag ''{1}''.", "lat", "home")); 78 78 double lat; 79 79 try { 80 80 lat = Double.parseDouble(v); 81 81 } catch(NumberFormatException e) { 82 throw new OsmDataParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}", "lat", "home", v)); 82 throw new OsmDataParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "lat", "home", v)); 83 83 } 84 84 85 85 v = getAttribute(xmlNode, "lon"); 86 86 if (v == null) 87 throw new OsmDataParsingException(tr("Missing attribute ''{0}'' on XML tag ''{1}''", "lon", "home")); 87 throw new OsmDataParsingException(tr("Missing attribute ''{0}'' on XML tag ''{1}''.", "lon", "home")); 88 88 double lon; 89 89 try { 90 90 lon = Double.parseDouble(v); 91 91 } catch(NumberFormatException e) { 92 throw new OsmDataParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}", "lon", "home", v)); 92 throw new OsmDataParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "lon", "home", v)); 93 93 } 94 94 95 95 v = getAttribute(xmlNode, "zoom"); 96 96 if (v == null) 97 throw new OsmDataParsingException(tr("Missing attribute ''{0}'' on XML tag ''{1}''", "zoom", "home")); 97 throw new OsmDataParsingException(tr("Missing attribute ''{0}'' on XML tag ''{1}''.", "zoom", "home")); 98 98 int zoom; 99 99 try { 100 100 zoom = Integer.parseInt(v); 101 101 } catch(NumberFormatException e) { 102 throw new OsmDataParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}", "zoom", "home", v)); 102 throw new OsmDataParsingException(tr("Illegal value for attribute ''{0}'' on XML tag ''{1}''. Got {2}.", "zoom", "home", v)); 103 103 } 104 104 userInfo.setHome(new LatLon(lat,lon)); -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r2115 r2181 145 145 boolean useDiffUpload = Main.pref.getBoolean("osm-server.atomic-upload", apiVersion.compareTo("0.6")>=0); 146 146 if (useDiffUpload && ! casUseDiffUploads) { 147 System.out.println(tr("WARNING: preference ''{0}'' or apiversion ''{1}'' of dataset requires to use diff uploads, but API is not able to handle them. Ignoring diff upload.", "osm-server.atomic-upload", apiVersion));147 System.out.println(tr("WARNING: preference ''{0}'' or API version ''{1}'' of dataset requires to use diff uploads, but API is not able to handle them. Ignoring diff upload.", "osm-server.atomic-upload", apiVersion)); 148 148 useDiffUpload = false; 149 149 }
Note:
See TracChangeset
for help on using the changeset viewer.