Changeset 2181 in josm
- Timestamp:
- 2009-09-22T15:34:19+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 69 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
r2163 r2181 68 68 public void export(Layer layer) { 69 69 if (layer == null) 70 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));70 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 71 71 if (! (layer instanceof OsmDataLayer) && ! (layer instanceof GpxLayer)) 72 throw new IllegalArgumentException(tr(" expected instance of OsmDataLayer or GpxLayer. Got ''{0}''.", layer.getClass().getName()));72 throw new IllegalArgumentException(tr("Expected instance of OsmDataLayer or GpxLayer. Got ''{0}''.", layer.getClass().getName())); 73 73 74 74 File file = createAndOpenSaveFileChooser(tr("Export GPX file"), ".gpx"); -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r2113 r2181 138 138 public static Command mergeNodes(OsmDataLayer layer, Collection<Node> nodes, Node targetNode) throws IllegalArgumentException{ 139 139 if (layer == null) 140 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "nodes"));140 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "nodes")); 141 141 if (targetNode == null) 142 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "targetNode"));142 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "targetNode")); 143 143 144 144 if (nodes == null) … … 220 220 public static Command mergeNodes(OsmDataLayer layer, BackreferencedDataSet backreferences, Collection<Node> nodes, Node targetNode) { 221 221 if (layer == null) 222 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "nodes"));222 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "nodes")); 223 223 if (targetNode == null) 224 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "targetNode"));224 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "targetNode")); 225 225 if (nodes == null) 226 226 return null; -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r2175 r2181 251 251 default: 252 252 // should not happen 253 throw new IllegalStateException(tr(" unexpected return value. Got {0}", ret));253 throw new IllegalStateException(tr("Unexpected return value. Got {0}.", ret)); 254 254 } 255 255 } … … 290 290 default: 291 291 // should not happen 292 throw new IllegalStateException(tr(" unexpected return value. Got {0}", ret));292 throw new IllegalStateException(tr("Unexpected return value. Got {0}.", ret)); 293 293 } 294 294 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r2026 r2181 291 291 public static void deleteRelation(OsmDataLayer layer, Relation toDelete) { 292 292 if (layer == null) 293 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));293 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 294 294 if (toDelete == null) 295 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "toDelete"));295 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "toDelete")); 296 296 297 297 Command cmd = DeleteCommand.delete(layer, Collections.singleton(toDelete)); -
trunk/src/org/openstreetmap/josm/command/CoordinateConflictResolveCommand.java
r2025 r2181 67 67 } else 68 68 // should not happen 69 throw new IllegalStateException(tr(" cannot resolve undecided conflict"));69 throw new IllegalStateException(tr("Cannot resolve undecided conflict.")); 70 70 71 71 // remember the layer this command was applied to -
trunk/src/org/openstreetmap/josm/command/DeletedStateConflictResolveCommand.java
r2070 r2181 77 77 } else 78 78 // should not happen 79 throw new IllegalStateException(tr(" cannot resolve undecided conflict"));79 throw new IllegalStateException(tr("Cannot resolve undecided conflict.")); 80 80 81 81 rememberConflict(conflict); -
trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java
r2017 r2181 76 76 protected void addConflict(Conflict<?> conflict) throws IllegalStateException { 77 77 if (hasConflictForMy(conflict.getMy())) 78 throw new IllegalStateException(tr(" already registered a conflict for primitive ''{0}''", conflict.getMy().toString()));78 throw new IllegalStateException(tr("Already registered a conflict for primitive ''{0}''.", conflict.getMy().toString())); 79 79 if (!conflicts.contains(conflict)) { 80 80 conflicts.add(conflict); … … 92 92 public void add(Conflict<?> conflict) throws IllegalStateException, IllegalArgumentException { 93 93 if (conflict == null) 94 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "conflict"));94 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "conflict")); 95 95 addConflict(conflict); 96 96 fireConflictAdded(); -
trunk/src/org/openstreetmap/josm/data/osm/BackreferencedDataSet.java
r2095 r2181 103 103 public BackreferencedDataSet(DataSet source) { 104 104 if (source == null) 105 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null"));105 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.")); 106 106 this.source = source; 107 107 int size = source.ways.size() + source.relations.size(); -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r2165 r2181 391 391 public OsmPrimitive getPrimitiveById(long id, OsmPrimitiveType type) { 392 392 if (id <= 0) 393 throw new IllegalArgumentException(tr(" parameter{0} > 0 required. Got{1}.", "id", id));393 throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected. Got ''{1}''.", "id", id)); 394 394 if (id <= 0) 395 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "type"));395 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "type")); 396 396 Collection<? extends OsmPrimitive> primitives = null; 397 397 switch(type) { -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r2120 r2181 176 176 public OsmPrimitive(long id) throws IllegalArgumentException { 177 177 if (id < 0) 178 throw new IllegalArgumentException(tr(" expectedid>= 0. Got {0}", id));178 throw new IllegalArgumentException(tr("Expected ID >= 0. Got {0}.", id)); 179 179 this.id = id; 180 180 this.version = 0; … … 300 300 public void setVisible(boolean visible) throws IllegalStateException{ 301 301 if (id == 0 && visible == false) 302 throw new IllegalStateException(tr(" aprimitive withid=0 can't be invisible"));302 throw new IllegalStateException(tr("A primitive with ID = 0 can't be invisible.")); 303 303 this.visible = visible; 304 304 } … … 336 336 public void setOsmId(long id, int version) { 337 337 if (id <= 0) 338 throw new IllegalArgumentException(tr(" id> 0 expected. Got {0}", id));338 throw new IllegalArgumentException(tr("ID > 0 expected. Got {0}.", id)); 339 339 if (version <= 0) 340 throw new IllegalArgumentException(tr(" version > 0 expected. Got {0}", version));340 throw new IllegalArgumentException(tr("Version > 0 expected. Got {0}.", version)); 341 341 this.id = id; 342 342 this.version = version; -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java
r2115 r2181 23 23 if (type.getAPIName().equals(typeName)) return type; 24 24 } 25 throw new IllegalArgumentException(tr(" parameter ''{0}'' is not a valid type name, got ''{1}''", "typeName", typeName));25 throw new IllegalArgumentException(tr("Parameter ''{0}'' is not a valid type name. Got ''{1}''.", "typeName", typeName)); 26 26 } 27 27 … … 34 34 if (cls.equals(Way.class)) return WAY; 35 35 if (cls.equals(Relation.class)) return RELATION; 36 throw new IllegalArgumentException(tr(" parameter ''{0}'' is not an acceptable class, got ''{1}''", "cls", cls.toString()));36 throw new IllegalArgumentException(tr("Parameter ''{0}'' is not an acceptable class. Got ''{1}''.", "cls", cls.toString())); 37 37 } 38 38 -
trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java
r2070 r2181 570 570 if (primitive == null) return; 571 571 if (! isApplicableToPrimitive()) 572 throw new IllegalStateException(tr(" tag collection can't be applied to a primitive because there are keys with multiple values"));572 throw new IllegalStateException(tr("Tag collection can't be applied to a primitive because there are keys with multiple values.")); 573 573 for (Tag tag: tags) { 574 574 if (tag.getValue() == null || tag.getValue().equals("")) { … … 591 591 if (primitives == null) return; 592 592 if (! isApplicableToPrimitive()) 593 throw new IllegalStateException(tr(" tag collection can't be applied to a primitive because there are keys with multiple values"));593 throw new IllegalStateException(tr("Tag collection can't be applied to a primitive because there are keys with multiple values.")); 594 594 for (OsmPrimitive primitive: primitives) { 595 595 applyTo(primitive); … … 608 608 if (primitive == null) return; 609 609 if (! isApplicableToPrimitive()) 610 throw new IllegalStateException(tr(" tag collection can't be applied to a primitive because there are keys with multiple values"));610 throw new IllegalStateException(tr("Tag collection can't be applied to a primitive because there are keys with multiple values.")); 611 611 primitive.removeAll(); 612 612 for (Tag tag: tags) { … … 626 626 if (primitives == null) return; 627 627 if (! isApplicableToPrimitive()) 628 throw new IllegalStateException(tr(" tag collection can't be applied to a primitive because there are keys with multiple values"));628 throw new IllegalStateException(tr("Tag collection can't be applied to a primitive because there are keys with multiple values.")); 629 629 for (OsmPrimitive primitive: primitives) { 630 630 replaceTagsOf(primitive); -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r2077 r2181 210 210 if (n==null) return; 211 211 if (incomplete) 212 throw new IllegalStateException(tr(" can't add node {0} to incomplete way {1}", n.getId(), getId()));212 throw new IllegalStateException(tr("Cannot add node {0} to incomplete way {1}.", n.getId(), getId())); 213 213 if (incomplete) return; 214 214 clearCached(); … … 228 228 if (n==null) return; 229 229 if (incomplete) 230 throw new IllegalStateException(tr(" can't add node {0} to incomplete way {1}", n.getId(), getId()));230 throw new IllegalStateException(tr("Cannot add node {0} to incomplete way {1}.", n.getId(), getId())); 231 231 clearCached(); 232 232 nodes.add(offs, n); -
trunk/src/org/openstreetmap/josm/data/osm/history/History.java
r2017 r2181 152 152 return primitive; 153 153 } 154 throw new NoSuchElementException(tr("There's no primitive with version {0} in this history", version)); 154 throw new NoSuchElementException(tr("There's no primitive with version {0} in this history.", version)); 155 155 } 156 156 … … 159 159 160 160 if (versions.isEmpty()) 161 throw new NoSuchElementException(tr("There's no version valid at date ''{0}'' in this history", date)); 161 throw new NoSuchElementException(tr("There's no version valid at date ''{0}'' in this history.", date)); 162 162 if (get(0).getTimestamp().compareTo(date)> 0) 163 throw new NoSuchElementException(tr("There's no version valid at date ''{0}'' in this history", date)); 163 throw new NoSuchElementException(tr("There's no version valid at date ''{0}'' in this history.", date)); 164 164 for (int i = 1; i < versions.size();i++) { 165 165 if (get(i-1).getTimestamp().compareTo(date) <= 0 … … 172 172 public HistoryOsmPrimitive get(int idx) { 173 173 if (idx < 0 || idx >= versions.size()) 174 throw new IndexOutOfBoundsException(tr(" parameter ''{0}'' in range 0..{1} expected, got {2}", "idx", versions.size()-1, idx));174 throw new IndexOutOfBoundsException(tr("Parameter ''{0}'' in range 0..{1} expected. Got ''{2}''.", "idx", versions.size()-1, idx)); 175 175 return versions.get(idx); 176 176 } … … 178 178 public HistoryOsmPrimitive getEarliest() { 179 179 if (isEmpty()) 180 throw new NoSuchElementException(tr(" no earliest version found. History is empty."));180 throw new NoSuchElementException(tr("No earliest version found. History is empty.")); 181 181 return sortAscending().versions.get(0); 182 182 } … … 184 184 public HistoryOsmPrimitive getLatest() { 185 185 if (isEmpty()) 186 throw new NoSuchElementException(tr(" no latest version found. History is empty."));186 throw new NoSuchElementException(tr("No latest version found. History is empty.")); 187 187 return sortDescending().versions.get(0); 188 188 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r2017 r2181 29 29 protected void ensurePositiveLong(long value, String name) { 30 30 if (value <= 0) 31 throw new IllegalArgumentException(tr(" parameter ''{0}'' > 0 expected, got ''{1}''", name, value));31 throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected. Got ''{1}''.", name, value)); 32 32 } 33 33 34 34 protected void ensureNotNull(Object obj, String name) { 35 35 if (obj == null) 36 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", name));36 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", name)); 37 37 } 38 38 … … 102 102 public int compareTo(HistoryOsmPrimitive o) { 103 103 if (this.id != o.id) 104 throw new ClassCastException(tr(" can't compare primitive withid''{0}'' to primitive withid''{1}''", o.id, this.id));104 throw new ClassCastException(tr("Can't compare primitive with ID ''{0}'' to primitive with ID ''{1}''.", o.id, this.id)); 105 105 return new Long(this.version).compareTo(o.version); 106 106 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryRelation.java
r1670 r2181 87 87 public RelationMember getRelationMember(int idx) throws IndexOutOfBoundsException { 88 88 if (idx < 0 || idx >= members.size()) 89 throw new IndexOutOfBoundsException(tr(" parameter {0} not in range 0..{1}, got {2}", "idx", members.size(),idx));89 throw new IndexOutOfBoundsException(tr("Parameter {0} not in range 0..{1}. Got ''{2}''.", "idx", members.size(),idx)); 90 90 return members.get(idx); 91 91 } … … 108 108 public void addMember(RelationMember member) throws IllegalArgumentException { 109 109 if (member == null) 110 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "member"));110 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "member")); 111 111 members.add(member); 112 112 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryWay.java
r1670 r2181 46 46 public long getNodeId(int idx) throws IndexOutOfBoundsException { 47 47 if (idx < 0 || idx >= nodeIds.size()) 48 throw new IndexOutOfBoundsException(tr(" parameter {0} not in range 0..{1}, got {2}", "idx", nodeIds.size(),idx));48 throw new IndexOutOfBoundsException(tr("Parameter {0} not in range 0..{1}. Got ''{2}''.", "idx", nodeIds.size(),idx)); 49 49 return nodeIds.get(idx); 50 50 } -
trunk/src/org/openstreetmap/josm/data/osm/history/RelationMember.java
r2017 r2181 29 29 this.role = (role == null ? "" : role); 30 30 if (primitiveType == null) 31 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "primitiveType"));31 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitiveType")); 32 32 this.primitiveType = primitiveType; 33 33 if (primitiveId <=0) 34 throw new IllegalArgumentException(tr(" parameter ''{0}'' > 0 expected, got ''{1}''", "primitiveId", primitiveId));34 throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected. Got ''{1}''.", "primitiveId", primitiveId)); 35 35 this.primitiveId = primitiveId; 36 36 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitor.java
r2025 r2181 42 42 public MergeSourceBuildingVisitor(DataSet selectionBase) throws IllegalArgumentException { 43 43 if (selectionBase == null) 44 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "selectionBase"));44 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "selectionBase")); 45 45 this.selectionBase = selectionBase; 46 46 this.hull = new DataSet(); -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r2107 r2181 284 284 int curLayerPos = layers.indexOf(layer); 285 285 if (curLayerPos == -1) 286 throw new IllegalArgumentException(tr(" layer not in list."));286 throw new IllegalArgumentException(tr("Layer not in list.")); 287 287 if (pos == curLayerPos) 288 288 return; // already in place. … … 301 301 int curLayerPos = layers.indexOf(layer); 302 302 if (curLayerPos == -1) 303 throw new IllegalArgumentException(tr(" layer not in list."));303 throw new IllegalArgumentException(tr("Layer not in list.")); 304 304 return curLayerPos; 305 305 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairType.java
r1954 r2181 80 80 public ListRole getOppositeRole(ListRole role) { 81 81 if (!isParticipatingIn(role)) 82 throw new IllegalStateException(tr(" role {0} is not participating in compare pair {1}", role.toString(), this.toString()));82 throw new IllegalStateException(tr("Role {0} is not participating in compare pair {1}.", role.toString(), this.toString())); 83 83 if (participatingRoles[0].equals(role)) 84 84 return participatingRoles[1]; -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
r2039 r2181 323 323 ArrayList<T> mergedEntries = getMergedEntries(); 324 324 if (current < 0 || current >= mergedEntries.size()) 325 throw new IllegalArgumentException(tr(" parameter current out of range: got {0}", current));325 throw new IllegalArgumentException(tr("Parameter current out of range. Got {0}.", current)); 326 326 for (int i=rows.length -1; i>=0; i--) { 327 327 int row = rows[i]; … … 375 375 376 376 if (current < 0 || current >= mergedEntries.size()) 377 throw new IllegalArgumentException(tr(" parameter current out of range: got {0}", current));377 throw new IllegalArgumentException(tr("Parameter current out of range. Got {0}.", current)); 378 378 if (current == mergedEntries.size() -1) { 379 379 copyToEnd(source, rows); … … 589 589 public boolean isSamePositionInOppositeList(int row) { 590 590 if (!isParticipatingInCurrentComparePair()) 591 throw new IllegalStateException(tr(" list in role {0} is currently not participating in a compare pair", role.toString()));591 throw new IllegalStateException(tr("List in role {0} is currently not participating in a compare pair.", role.toString())); 592 592 if (row >= getEntries().size()) return false; 593 593 if (row >= getOppositeEntries().size()) return false; … … 613 613 public boolean isIncludedInOppositeList(int row) { 614 614 if (!isParticipatingInCurrentComparePair()) 615 throw new IllegalStateException(tr(" list in role {0} is currently not participating in a compare pair", role.toString()));615 throw new IllegalStateException(tr("List in role {0} is currently not participating in a compare pair.", role.toString())); 616 616 617 617 if (row >= getEntries().size()) return false; … … 762 762 if (index < compareModes.size()) 763 763 return compareModes.get(index); 764 throw new IllegalArgumentException(tr(" unexpected value of parameter\"index\". Got {0}", index));764 throw new IllegalArgumentException(tr("Unexpected value of parameter ''index''. Got {0}.", index)); 765 765 } 766 766 … … 776 776 int i = compareModes.indexOf(anItem); 777 777 if (i < 0) 778 throw new IllegalStateException(tr(" item {0} not found in list", anItem));778 throw new IllegalStateException(tr("Item {0} not found in list.", anItem)); 779 779 selectedIdx = i; 780 780 fireModelDataChanged(); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java
r2165 r2181 436 436 putValue(Action.NAME, tr("> bottom")); 437 437 } 438 putValue(Action.SHORT_DESCRIPTION, tr("Copy my selected elements to the end of the list of merged elements")); 438 putValue(Action.SHORT_DESCRIPTION, tr("Copy my selected elements to the end of the list of merged elements.")); 439 439 setEnabled(false); 440 440 } … … 463 463 putValue(Action.NAME, "> before"); 464 464 } 465 putValue(Action.SHORT_DESCRIPTION, tr("Copy my selected elements before the first selected element in the list of merged elements")); 465 putValue(Action.SHORT_DESCRIPTION, tr("Copy my selected elements before the first selected element in the list of merged elements.")); 466 466 setEnabled(false); 467 467 } … … 497 497 putValue(Action.NAME, "> after"); 498 498 } 499 putValue(Action.SHORT_DESCRIPTION, tr("Copy my selected elements after the first selected element in the list of merged elements")); 499 putValue(Action.SHORT_DESCRIPTION, tr("Copy my selected elements after the first selected element in the list of merged elements.")); 500 500 setEnabled(false); 501 501 } … … 527 527 putValue(Action.NAME, "< top"); 528 528 } 529 putValue(Action.SHORT_DESCRIPTION, tr("Copy their selected element to the start of the list of merged elements")); 529 putValue(Action.SHORT_DESCRIPTION, tr("Copy their selected element to the start of the list of merged elements.")); 530 530 setEnabled(false); 531 531 } … … 550 550 putValue(Action.NAME, "< bottom"); 551 551 } 552 putValue(Action.SHORT_DESCRIPTION, tr("Copy their selected elements to the end of the list of merged elements")); 552 putValue(Action.SHORT_DESCRIPTION, tr("Copy their selected elements to the end of the list of merged elements.")); 553 553 setEnabled(false); 554 554 } … … 572 572 putValue(Action.NAME, "< before"); 573 573 } 574 putValue(Action.SHORT_DESCRIPTION, tr("Copy their selected elements before the first selected element in the list of merged elements")); 574 putValue(Action.SHORT_DESCRIPTION, tr("Copy their selected elements before the first selected element in the list of merged elements.")); 575 575 setEnabled(false); 576 576 } … … 632 632 putValue(Action.NAME, tr("Up")); 633 633 } 634 putValue(Action.SHORT_DESCRIPTION, tr("Move up the selected elements by one position")); 634 putValue(Action.SHORT_DESCRIPTION, tr("Move up the selected elements by one position.")); 635 635 setEnabled(false); 636 636 } … … 664 664 putValue(Action.NAME, tr("Down")); 665 665 } 666 putValue(Action.SHORT_DESCRIPTION, tr("Move down the selected entries by one position")); 666 putValue(Action.SHORT_DESCRIPTION, tr("Move down the selected entries by one position.")); 667 667 setEnabled(false); 668 668 } … … 696 696 putValue(Action.NAME, tr("Remove")); 697 697 } 698 putValue(Action.SHORT_DESCRIPTION, tr("Remove the selected entries from the list of merged elements")); 698 putValue(Action.SHORT_DESCRIPTION, tr("Remove the selected entries from the list of merged elements.")); 699 699 setEnabled(false); 700 700 } … … 726 726 public FreezeAction() { 727 727 putValue(Action.NAME, tr("Freeze")); 728 putValue(Action.SHORT_DESCRIPTION, tr("Freeze the current list of merged elements")); 728 putValue(Action.SHORT_DESCRIPTION, tr("Freeze the current list of merged elements.")); 729 729 putValue(PROP_SELECTED, false); 730 730 setEnabled(true); … … 759 759 if (state == ItemEvent.SELECTED) { 760 760 putValue(Action.NAME, tr("Unfreeze")); 761 putValue(Action.SHORT_DESCRIPTION, tr("Unfreeze the list of merged elements and start merging")); 761 putValue(Action.SHORT_DESCRIPTION, tr("Unfreeze the list of merged elements and start merging.")); 762 762 model.setFrozen(true); 763 763 } else if (state == ItemEvent.DESELECTED) { 764 764 putValue(Action.NAME, tr("Freeze")); 765 putValue(Action.SHORT_DESCRIPTION, tr("Freeze the current list of merged elements")); 765 putValue(Action.SHORT_DESCRIPTION, tr("Freeze the current list of merged elements.")); 766 766 model.setFrozen(false); 767 767 } … … 786 786 if (newValue) { 787 787 lblFrozenState.setText( 788 tr("<html>Click <strong>{0}</strong> to start merging my and their entries</html>", 788 tr("<html>Click <strong>{0}</strong> to start merging my and their entries.</html>", 789 789 freezeAction.getValue(Action.NAME)) 790 790 ); 791 791 } else { 792 792 lblFrozenState.setText( 793 tr("<html>Click <strong>{0}</strong> to finish merging my and their entries</html>", 793 tr("<html>Click <strong>{0}</strong> to finish merging my and their entries.</html>", 794 794 freezeAction.getValue(Action.NAME)) 795 795 ); … … 879 879 protected void setParticipatingInSynchronizedScrolling(Adjustable adjustable, boolean isParticipating) { 880 880 if (adjustable == null) 881 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "adjustable"));881 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "adjustable")); 882 882 883 883 if (! synchronizedAdjustables.contains(adjustable)) 884 throw new IllegalStateException(tr(" adjustable {0} not registered yet. Can't set participation in synchronized adjustment",adjustable));884 throw new IllegalStateException(tr("Adjustable {0} not registered yet. Can't set participation in synchronized adjustment.", adjustable)); 885 885 886 886 enabledMap.put(adjustable, isParticipating); … … 897 897 protected boolean isParticipatingInSynchronizedScrolling(Adjustable adjustable) throws IllegalStateException { 898 898 if (! synchronizedAdjustables.contains(adjustable)) 899 throw new IllegalStateException(tr(" adjustable {0} not registered yet",adjustable));899 throw new IllegalStateException(tr("Adjustable {0} not registered yet.", adjustable)); 900 900 901 901 return enabledMap.get(adjustable); … … 920 920 protected void adapt(final JCheckBox view, final Adjustable adjustable) throws IllegalArgumentException, IllegalStateException { 921 921 if (adjustable == null) 922 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "adjustable"));922 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "adjustable")); 923 923 if (view == null) 924 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "view"));924 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "view")); 925 925 926 926 if (! synchronizedAdjustables.contains(adjustable)) { -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModel.java
r2165 r2181 31 31 public void populate(Way my, Way their) { 32 32 if (my == null) 33 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "my"));33 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "my")); 34 34 if (their == null) 35 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "their"));35 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "their")); 36 36 getMergedEntries().clear(); 37 37 getMyEntries().clear(); … … 65 65 public WayNodesConflictResolverCommand buildResolveCommand(Way my, Way their) { 66 66 if (my == null) 67 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "my"));67 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "my")); 68 68 if (their == null) 69 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "their"));69 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "their")); 70 70 if (! isFrozen()) 71 throw new IllegalArgumentException(tr("Merged nodes not frozen yet. Can't build resolution command")); 71 throw new IllegalArgumentException(tr("Merged nodes not frozen yet. Can't build resolution command.")); 72 72 return new WayNodesConflictResolverCommand(my, their, getMergedEntries()); 73 73 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTableCellRenderer.java
r2039 r2181 180 180 default: 181 181 // should not happen 182 throw new RuntimeException(tr(" unexpected column index. Got {0}", column));182 throw new RuntimeException(tr("Unexpected column index. Got {0}.", column)); 183 183 } 184 184 return this; -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java
r2070 r2181 295 295 public void decideDeletedStateConflict(MergeDecisionType decision) throws IllegalArgumentException{ 296 296 if (decision == null) 297 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "decision"));297 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "decision")); 298 298 this.deletedMergeDecision = decision; 299 299 setChanged(); … … 310 310 public void decideVisibleStateConflict(MergeDecisionType decision) throws IllegalArgumentException { 311 311 if (decision == null) 312 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "decision"));312 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "decision")); 313 313 this.visibleMergeDecision = decision; 314 314 setChanged(); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java
r2165 r2181 71 71 public void populate(Relation my, Relation their) { 72 72 if (my == null) 73 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "my"));73 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "my")); 74 74 if (their == null) 75 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "their"));75 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "their")); 76 76 77 77 getMergedEntries().clear(); … … 114 114 public RelationMemberConflictResolverCommand buildResolveCommand(Relation my, Relation their) { 115 115 if (my == null) 116 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "my"));116 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "my")); 117 117 if (their == null) 118 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "their"));118 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "their")); 119 119 if (! isFrozen()) 120 throw new IllegalArgumentException(tr(" merged nodes not frozen yet. Can't build resolution command"));120 throw new IllegalArgumentException(tr("Merged nodes not frozen yet. Can't build resolution command")); 121 121 return new RelationMemberConflictResolverCommand(my, their, getMergedEntries()); 122 122 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeItem.java
r2165 r2181 31 31 public TagMergeItem(String key, String myTagValue, String theirTagValue) { 32 32 if (key == null) { 33 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "key"));33 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "key")); 34 34 } 35 35 this.key = key; … … 50 50 */ 51 51 public TagMergeItem(String key, OsmPrimitive my, OsmPrimitive their) { 52 if (key == null) throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "key"));53 if (my == null) throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "my"));54 if (their == null) throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "their"));52 if (key == null) throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "key")); 53 if (my == null) throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "my")); 54 if (their == null) throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "their")); 55 55 this.key = key; 56 56 myTagValue = my.get(key); … … 66 66 */ 67 67 public void decide(MergeDecisionType decision) throws IllegalArgumentException { 68 if (decision == null) throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "decision"));68 if (decision == null) throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "decision")); 69 69 this.mergeDecision = decision; 70 70 } … … 96 96 */ 97 97 public void applyToMyPrimitive(OsmPrimitive primitive) throws IllegalArgumentException, IllegalStateException { 98 if (primitive == null) throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "primitive"));98 if (primitive == null) throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitive")); 99 99 if (mergeDecision == MergeDecisionType.UNDECIDED) { 100 throw new IllegalStateException(tr(" cannot apply undecided tag merge item"));100 throw new IllegalStateException(tr("Cannot apply undecided tag merge item.")); 101 101 } else if (mergeDecision == MergeDecisionType.KEEP_THEIR) { 102 102 if (theirTagValue == null) { -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeTableCellRenderer.java
r2017 r2181 37 37 default: 38 38 // should not happen, but just in case 39 throw new IllegalArgumentException(tr("Parameter 'col' must be 0 or 1. Got {0}", col)); 39 throw new IllegalArgumentException(tr("Parameter 'col' must be 0 or 1. Got {0}.", col)); 40 40 } 41 41 return this; -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueResolutionDecision.java
r2141 r2181 49 49 public MultiValueResolutionDecision(TagCollection tags) throws IllegalArgumentException { 50 50 if (tags == null) 51 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "tags"));51 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "tags")); 52 52 if (tags.isEmpty()) 53 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be empty", "tags"));53 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be empty.", "tags")); 54 54 if (tags.getKeys().size() != 1) 55 throw new IllegalArgumentException(tr(" parameter ''{0}'' with tags for exactly one key expected. Got {1}", "tags", tags.getKeys().size()));55 throw new IllegalArgumentException(tr("Parameter ''{0}'' with tags for exactly one key expected. Got {1}.", "tags", tags.getKeys().size())); 56 56 this.tags = tags; 57 57 autoDecide(); … … 97 97 public void keepOne(String value) throws IllegalArgumentException, IllegalStateException { 98 98 if (value == null) 99 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "value"));99 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "value")); 100 100 if (!tags.getValues().contains(value)) 101 throw new IllegalStateException(tr(" tag collection doesn't include the selected value ''{0}''", value));101 throw new IllegalStateException(tr("Tag collection doesn't include the selected value ''{0}''.", value)); 102 102 this.value = value; 103 103 this.type = MultiValueDecisionType.KEEP_ONE; … … 134 134 public String getChosenValue() throws IllegalStateException { 135 135 switch(type) { 136 case UNDECIDED: throw new IllegalStateException(tr("Not decided yet")); 136 case UNDECIDED: throw new IllegalStateException(tr("Not decided yet.")); 137 137 case KEEP_ONE: return value; 138 138 case KEEP_NONE: return null; … … 211 211 if (primitive == null) return; 212 212 if (!isDecided()) 213 throw new IllegalStateException(tr("Not decided yet")); 213 throw new IllegalStateException(tr("Not decided yet.")); 214 214 String key = tags.getKeys().iterator().next(); 215 215 String value = getChosenValue(); … … 247 247 public Command buildChangeCommand(OsmPrimitive primitive) throws IllegalArgumentException, IllegalStateException { 248 248 if (primitive == null) 249 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "primitive"));249 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitive")); 250 250 if (!isDecided()) 251 throw new IllegalStateException(tr("Not decided yet")); 251 throw new IllegalStateException(tr("Not decided yet.")); 252 252 String key = tags.getKeys().iterator().next(); 253 253 String value = getChosenValue(); … … 266 266 public Command buildChangeCommand(Collection<? extends OsmPrimitive> primitives) { 267 267 if (primitives == null) 268 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "primitives"));268 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitives")); 269 269 if (!isDecided()) 270 throw new IllegalStateException(tr("Not decided yet")); 270 throw new IllegalStateException(tr("Not decided yet.")); 271 271 String key = tags.getKeys().iterator().next(); 272 272 String value = getChosenValue(); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecision.java
r2070 r2181 19 19 public RelationMemberConflictDecision(Relation relation, int pos) throws IllegalArgumentException { 20 20 if (relation == null) 21 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "relation"));21 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "relation")); 22 22 RelationMember member = relation.getMember(pos); 23 23 if (member == null) 24 throw new IndexOutOfBoundsException(tr(" pos{0} is out of range.current number of members: {1}", pos, relation.getMembersCount()));24 throw new IndexOutOfBoundsException(tr("Position {0} is out of range. Current number of members is {1}.", pos, relation.getMembersCount())); 25 25 this.relation = relation; 26 26 this.pos = pos; -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java
r2070 r2181 84 84 public void populate(TagCollection tags) { 85 85 if (tags == null) 86 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "tags"));86 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "tags")); 87 87 this.tags = tags; 88 88 keys = new ArrayList<String>(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
r2070 r2181 177 177 protected void showHistory(History h) throws IllegalArgumentException { 178 178 if (h == null) 179 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "h"));179 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "h")); 180 180 if (HistoryBrowserDialogManager.getInstance().existsDialog(h.getId())) { 181 181 HistoryBrowserDialogManager.getInstance().show(h.getId()); … … 237 237 public History get(int idx) throws IndexOutOfBoundsException { 238 238 if (idx < 0 || idx >= data.size()) 239 throw new IndexOutOfBoundsException(tr(" index out of boundsGot {0}", idx));239 throw new IndexOutOfBoundsException(tr("Index out of bounds. Got {0}.", idx)); 240 240 return data.get(idx); 241 241 } … … 340 340 //putValue(Action.SMALL_ICON, ImageProvider.get("dialogs","refresh")); 341 341 putValue(Action.NAME, tr("Show")); 342 putValue(Action.SHORT_DESCRIPTION, tr("Display the history of the selected primitive")); 342 putValue(Action.SHORT_DESCRIPTION, tr("Display the history of the selected primitive.")); 343 343 } 344 344 -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r2159 r2181 279 279 this(); 280 280 if (layer == null) 281 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));281 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 282 282 this.layer = layer; 283 283 putValue(NAME, tr("Delete")); … … 360 360 this(); 361 361 if (layer == null) 362 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));362 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 363 363 this.layer = layer; 364 364 putValue(NAME, tr("Show/Hide")); … … 407 407 this(); 408 408 if (layer == null) 409 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));409 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 410 410 this.layer = layer; 411 411 putValue(NAME, tr("Activate")); … … 462 462 this(); 463 463 if (layer == null) 464 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));464 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 465 465 this.layer = layer; 466 466 putValue(NAME, tr("Merge")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r2070 r2181 119 119 public ChildRelationBrowser(OsmDataLayer layer) throws IllegalArgumentException { 120 120 if (layer == null) 121 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));121 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 122 122 this.layer = layer; 123 123 model = new RelationTreeModel(); … … 176 176 class EditAction extends AbstractAction implements TreeSelectionListener { 177 177 public EditAction() { 178 putValue(SHORT_DESCRIPTION, tr("Edit the relation the currently selected relation member refers to")); 178 putValue(SHORT_DESCRIPTION, tr("Edit the relation the currently selected relation member refers to.")); 179 179 putValue(SMALL_ICON, ImageProvider.get("dialogs", "edit")); 180 180 putValue(NAME, tr("Edit")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
r2077 r2181 76 76 super(tr("Download referring relations"), monitor, false /* don't ignore exception */); 77 77 if (child == null) 78 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "child"));78 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "child")); 79 79 if (layer == null) 80 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));80 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 81 81 if (child.getId() == 0) 82 throw new IllegalArgumentException(tr("child.getId() >0 expected. Got {1}", child.getId())); 82 throw new IllegalArgumentException(tr("Value of child.getId() > 0 expected. Got {1}.", child.getId())); 83 83 referrers = null; 84 84 this.layer = layer; … … 197 197 } catch(Exception e) { 198 198 if (cancelled) { 199 System.out.println(tr("Warning: ignoring exception because task is cancelled. Exception: {0}", e.toString()));199 System.out.println(tr("Warning: Ignoring exception because task is cancelled. Exception: {0}", e.toString())); 200 200 return; 201 201 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java
r2070 r2181 106 106 ); 107 107 if (layer == null) 108 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));108 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 109 109 this.layer = layer; 110 110 setRelation(relation); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTableModel.java
r2017 r2181 31 31 public SelectionTableModel(OsmDataLayer layer) throws IllegalArgumentException { 32 32 if (layer == null) 33 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));33 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 34 34 this.layer = layer; 35 35 cache = new ArrayList<OsmPrimitive>(); -
trunk/src/org/openstreetmap/josm/gui/history/AdjustmentSynchronizer.java
r2165 r2181 76 76 protected void setParticipatingInSynchronizedScrolling(Adjustable adjustable, boolean isParticipating) { 77 77 if (adjustable == null) 78 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "adjustable"));78 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "adjustable")); 79 79 80 80 if (! synchronizedAdjustables.contains(adjustable)) 81 throw new IllegalStateException(tr(" adjustable {0} not registered yet. Can't set participation in synchronized adjustment",adjustable));81 throw new IllegalStateException(tr("Adjustable {0} not registered yet. Can't set participation in synchronized adjustment.", adjustable)); 82 82 83 83 enabledMap.put(adjustable, isParticipating); … … 94 94 protected boolean isParticipatingInSynchronizedScrolling(Adjustable adjustable) throws IllegalStateException { 95 95 if (! synchronizedAdjustables.contains(adjustable)) 96 throw new IllegalStateException(tr(" adjustable {0} not registered yet",adjustable));96 throw new IllegalStateException(tr("Adjustable {0} not registered yet.", adjustable)); 97 97 98 98 return enabledMap.get(adjustable); … … 117 117 protected void adapt(final JCheckBox view, final Adjustable adjustable) throws IllegalArgumentException, IllegalStateException { 118 118 if (adjustable == null) 119 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "adjustable"));119 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "adjustable")); 120 120 if (view == null) 121 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "view"));121 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "view")); 122 122 123 123 if (! synchronizedAdjustables.contains(adjustable)) { -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r2044 r2181 140 140 public TagTableModel getTagTableModel(PointInTimeType pointInTimeType) throws IllegalArgumentException { 141 141 if (pointInTimeType == null) 142 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "pointInTimeType"));142 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "pointInTimeType")); 143 143 if (pointInTimeType.equals(PointInTimeType.CURRENT_POINT_IN_TIME)) 144 144 return currentTagTableModel; … … 152 152 public NodeListTableModel getNodeListTableModel(PointInTimeType pointInTimeType) throws IllegalArgumentException { 153 153 if (pointInTimeType == null) 154 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "pointInTimeType"));154 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "pointInTimeType")); 155 155 if (pointInTimeType.equals(PointInTimeType.CURRENT_POINT_IN_TIME)) 156 156 return currentNodeListTableModel; … … 164 164 public RelationMemberTableModel getRelationMemberTableModel(PointInTimeType pointInTimeType) throws IllegalArgumentException { 165 165 if (pointInTimeType == null) 166 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "pointInTimeType"));166 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "pointInTimeType")); 167 167 if (pointInTimeType.equals(PointInTimeType.CURRENT_POINT_IN_TIME)) 168 168 return currentRelationMemberTableModel; … … 176 176 public void setReferencePointInTime(HistoryOsmPrimitive reference) throws IllegalArgumentException, IllegalStateException{ 177 177 if (reference == null) 178 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "reference"));178 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "reference")); 179 179 if (history == null) 180 throw new IllegalStateException(tr(" history not initialized yet. Failed to set reference primitive."));180 throw new IllegalStateException(tr("History not initialized yet. Failed to set reference primitive.")); 181 181 if (reference.getId() != history.getId()) 182 throw new IllegalArgumentException(tr(" failed to set reference.referenceid{0} doesn't match historyid {1}", reference.getId(), history.getId()));182 throw new IllegalArgumentException(tr("Failed to set reference. Reference ID {0} does not match history ID {1}.", reference.getId(), history.getId())); 183 183 HistoryOsmPrimitive primitive = history.getByVersion(reference.getVersion()); 184 184 if (primitive == null) 185 throw new IllegalArgumentException(tr(" failed to set reference.reference version {0} not available in history", reference.getVersion()));185 throw new IllegalArgumentException(tr("Failed to set reference. Reference version {0} not available in history.", reference.getVersion())); 186 186 187 187 this.reference = reference; … … 195 195 public void setCurrentPointInTime(HistoryOsmPrimitive current) throws IllegalArgumentException, IllegalStateException{ 196 196 if (current == null) 197 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "current"));197 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "current")); 198 198 if (history == null) 199 throw new IllegalStateException(tr(" history not initialized yet. Failed to set current primitive."));199 throw new IllegalStateException(tr("History not initialized yet. Failed to set current primitive.")); 200 200 if (current.getId() != history.getId()) 201 throw new IllegalArgumentException(tr(" failed to set reference.referenceid{0} doesn't match historyid {1}", current.getId(), history.getId()));201 throw new IllegalArgumentException(tr("Hailed to set reference. Reference ID {0} does not match history ID {1}.", current.getId(), history.getId())); 202 202 HistoryOsmPrimitive primitive = history.getByVersion(current.getVersion()); 203 203 if (primitive == null) 204 throw new IllegalArgumentException(tr(" failed to set current. current version {0} not available in history", current.getVersion()));204 throw new IllegalArgumentException(tr("Failed to set current primitive. Current version {0} not available in history.", current.getVersion())); 205 205 this.current = current; 206 206 initTagTableModels(); … … 238 238 public HistoryOsmPrimitive getPointInTime(PointInTimeType type) throws IllegalArgumentException { 239 239 if (type == null) 240 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "type"));240 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "type")); 241 241 if (type.equals(PointInTimeType.CURRENT_POINT_IN_TIME)) 242 242 return current; -
trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java
r2070 r2181 38 38 public HistoryLoadTask add(long id, OsmPrimitiveType type) { 39 39 if (id <= 0) 40 throw new IllegalArgumentException(tr(" id> 0 expected, got {0}", id));40 throw new IllegalArgumentException(tr("ID > 0 expected. Got {0}.", id)); 41 41 if (type == null) 42 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "type"));42 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "type")); 43 43 if (!toLoad.containsKey(id)) { 44 44 toLoad.put(id, type); … … 49 49 public HistoryLoadTask add(HistoryOsmPrimitive primitive) { 50 50 if (primitive == null) 51 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "primitive"));51 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitive")); 52 52 if (!toLoad.containsKey(primitive.getId())) { 53 53 toLoad.put(primitive.getId(), primitive.getType()); … … 58 58 public HistoryLoadTask add(History history) { 59 59 if (history == null) 60 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "history"));60 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "history")); 61 61 if (!toLoad.containsKey(history.getId())) { 62 62 toLoad.put(history.getId(), history.getEarliest().getType()); … … 67 67 public HistoryLoadTask add(OsmPrimitive primitive) { 68 68 if (primitive == null) 69 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "primitive"));69 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitive")); 70 70 return add(primitive.getId(), OsmPrimitiveType.from(primitive)); 71 71 } … … 73 73 public HistoryLoadTask add(Collection<? extends OsmPrimitive> primitives) { 74 74 if (primitives == null) 75 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "primitives"));75 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitives")); 76 76 for (OsmPrimitive primitive: primitives) { 77 77 if (primitive == null) { -
trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java
r2096 r2181 74 74 public VersionInfoPanel(HistoryBrowserModel model, PointInTimeType pointInTimeType) throws IllegalArgumentException { 75 75 if (pointInTimeType == null) 76 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "pointInTimeType"));76 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "pointInTimeType")); 77 77 if (model == null) 78 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "model"));78 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "model")); 79 79 80 80 this.model = model; -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayerInfo.java
r2025 r2181 29 29 public SaveLayerInfo(OsmDataLayer layer) { 30 30 if (layer == null) 31 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layer"));31 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layer")); 32 32 this.layer = layer; 33 33 this.doSaveToFile = layer.requiresSaveToFile(); -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayerTask.java
r2025 r2181 36 36 protected SaveLayerTask(SaveLayerInfo layerInfo, ProgressMonitor monitor) { 37 37 if (layerInfo == null) 38 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "layerInfo"));38 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "layerInfo")); 39 39 if (monitor == null) { 40 40 monitor = NullProgressMonitor.INSTANCE; -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r2158 r2181 997 997 public void addOrUpdate(Changeset cs) { 998 998 if (cs.getId() <= 0 ) 999 throw new IllegalArgumentException(tr(" changesetid> 0 expected. Got {1}", "id", cs.getId()));999 throw new IllegalArgumentException(tr("Changeset ID > 0 expected. Got {0}.", cs.getId())); 1000 1000 internalAddOrUpdate(cs); 1001 1001 fireContentsChanged(this, 0, getSize()); -
trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java
r2115 r2181 49 49 public UploadLayerTask(OsmDataLayer layer, ProgressMonitor monitor, Changeset changeset, boolean closeChangesetAfterUpload) { 50 50 if (layer == null) 51 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", layer));51 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", layer)); 52 52 if (monitor == null) { 53 53 monitor = NullProgressMonitor.INSTANCE; -
trunk/src/org/openstreetmap/josm/gui/progress/SwingRenderingProgressMonitor.java
r2025 r2181 25 25 super(new CancelHandler()); 26 26 if (delegate == null) 27 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "delegate"));27 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "delegate")); 28 28 this.delegate = delegate; 29 29 } -
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 } -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r2017 r2181 341 341 public static ImageIcon get(OsmPrimitiveType type) throws IllegalArgumentException { 342 342 if (type == null) 343 throw new IllegalArgumentException(tr(" parameter ''{0}'' must not be null", "type"));343 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "type")); 344 344 return get("data", type.getAPIName()); 345 345 } -
trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
r2070 r2181 102 102 Matcher m = p.matcher(preferenceValue); 103 103 if (!m.find()) 104 throw new WindowGeometryException(tr(" preference with key ''{0}'' doesn''t include ''{1}''. Can''t restore window geometry from preferences.", preferenceKey, field));104 throw new WindowGeometryException(tr("Preference with key ''{0}'' does not include ''{1}''. Can''t restore window geometry from preferences.", preferenceKey, field)); 105 105 v = m.group(1); 106 106 return Integer.parseInt(v); … … 108 108 throw e; 109 109 } catch(NumberFormatException e) { 110 throw new WindowGeometryException(tr(" preference with key ''{0}'' doesn''t provide an int value for ''{1}''. Got {2}. Can''t restore window geometry from preferences.", preferenceKey, field, v));110 throw new WindowGeometryException(tr("Preference with key ''{0}'' does not provide an int value for ''{1}''. Got {2}. Can''t restore window geometry from preferences.", preferenceKey, field, v)); 111 111 } catch(Exception e) { 112 throw new WindowGeometryException(tr(" failed to parse field ''{1}'' in preference with key ''{0}''. Exception was: {2}. Can''t restore window geometry from preferences.", preferenceKey, field, e.toString()), e);112 throw new WindowGeometryException(tr("Failed to parse field ''{1}'' in preference with key ''{0}''. Exception was: {2}. Can''t restore window geometry from preferences.", preferenceKey, field, e.toString()), e); 113 113 } 114 114 } … … 117 117 String value = Main.pref.get(preferenceKey); 118 118 if (value == null) 119 throw new WindowGeometryException(tr(" preference with key ''{0}'' doesn''t exist. Can''t restore window geometry from preferences.", preferenceKey));119 throw new WindowGeometryException(tr("Preference with key ''{0}'' does not exist. Can''t restore window geometry from preferences.", preferenceKey)); 120 120 topLeft = new Point(); 121 121 extent = new Dimension(); … … 156 156 initFromPreferences(preferenceKey); 157 157 } catch(WindowGeometryException e) { 158 System.out.println(tr("Warning: failed to restore window geometry from key ''{0}''. Falling back to default geometry. Details: {1}", preferenceKey, e.getMessage()));158 System.out.println(tr("Warning: Failed to restore window geometry from key ''{0}''. Falling back to default geometry. Details: {1}", preferenceKey, e.getMessage())); 159 159 initFromWindowGeometry(defaultGeometry); 160 160 }
Note:
See TracChangeset
for help on using the changeset viewer.