Ticket #3565: typo_and_unification.diff
| File typo_and_unification.diff, 14.2 KB (added by , 17 years ago) |
|---|
-
org/openstreetmap/josm/io/OsmApi.java
79 79 static public OsmApi getOsmApi() { 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 } 85 85 … … 131 131 */ 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 } 137 137 … … 250 250 ret = sendRequest("PUT", OsmPrimitiveType.from(osm).getAPIName()+"/create", toXml(osm, true),monitor); 251 251 osm.setOsmId(Long.parseLong(ret.trim()), 1); 252 252 } catch(NumberFormatException e){ 253 throw new OsmTransferException(tr(" unexpected format of id replied 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 } 256 256 … … 276 276 osm.setOsmId(osm.getId(), Integer.parseInt(ret.trim())); 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 } 282 282 … … 310 310 */ 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..."))); 316 316 initialize(progressMonitor); … … 320 320 changeset.setId(Long.parseLong(ret.trim())); 321 321 changeset.setOpen(true); 322 322 } catch(NumberFormatException e){ 323 throw new OsmTransferException(tr(" unexpected format of id replied 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()))); 326 326 } finally { … … 342 342 */ 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 } … … 377 377 */ 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 } … … 595 595 if (changeset == null) 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(" id of current changeset > 0 required. Current id is {0}", changeset.getId()));598 throw new OsmTransferException(tr("Id of current changeset > 0 required. Current id is {0}", changeset.getId())); 599 599 } 600 600 /** 601 601 * Replies the changeset data uploads are currently directed to -
org/openstreetmap/josm/io/OsmChangesetParser.java
69 69 // -- id 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; 75 75 try { 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 numeric value for attribute ''{0}''. Got ''{1}''", "id", id)); 82 82 } 83 83 current.setId(id); 84 84 … … 106 106 // -- open 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); 112 112 } else if (value.equals("false")) { 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 118 118 // -- min_lon and min_lat … … 125 125 try { 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; 131 131 try { 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)); 137 137 … … 141 141 try { 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; 147 147 try { 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)); 153 153 } -
org/openstreetmap/josm/io/OsmHistoryReader.java
65 65 protected long getMandatoryAttributeLong(Attributes attr, String name) throws SAXException{ 66 66 String v = attr.getValue(name); 67 67 if (v == null) { 68 throwException(tr(" mandatory attribute ''{0}'' missing", name));68 throwException(tr("Mandatory attribute ''{0}'' missing", name)); 69 69 } 70 70 Long l = 0l; 71 71 try { 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; 80 80 } … … 82 82 protected int getMandatoryAttributeInt(Attributes attr, String name) throws SAXException{ 83 83 String v = attr.getValue(name); 84 84 if (v == null) { 85 throwException(tr(" mandatory attribute ''{0}'' missing", name));85 throwException(tr("Mandatory attribute ''{0}'' missing", name)); 86 86 } 87 87 Integer i = 0; 88 88 try { 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; 97 97 } … … 99 99 protected String getMandatoryAttributeString(Attributes attr, String name) throws SAXException{ 100 100 String v = attr.getValue(name); 101 101 if (v == null) { 102 throwException(tr(" mandatory attribute ''{0}'' missing", name));102 throwException(tr("Mandatory attribute ''{0}'' missing", name)); 103 103 } 104 104 return v; 105 105 } … … 107 107 protected boolean getMandatoryAttributeBoolean(Attributes attr, String name) throws SAXException{ 108 108 String v = attr.getValue(name); 109 109 if (v == null) { 110 throwException(tr(" mandatory attribute ''{0}'' missing", name));110 throwException(tr("Mandatory attribute ''{0}'' missing", 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; 117 117 } … … 171 171 try { 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"); 177 177 org.openstreetmap.josm.data.osm.history.RelationMember member = new org.openstreetmap.josm.data.osm.history.RelationMember(role, type,ref); -
org/openstreetmap/josm/io/OsmReader.java
225 225 Collection<Long> list = ways.get(current.id); 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> element not as direct child of element <way>") 229 229 ); 230 230 } 231 231 if (atts.getValue("ref") == null) { … … 415 415 if (id <= 0) 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 421 421 ) … … 428 428 } 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 " +431 logger.warning(tr("Marked way {0} with {1} nodes incomplete because at least one node was missing in the " + 432 432 "loaded data and is therefore incomplete too", externalWayId, w.getNodesCount())); 433 433 w.incomplete = true; 434 434 ds.addPrimitive(w);
