Changeset 3674 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2010-11-25T18:06:50+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/validation
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/TestError.java
r3671 r3674 34 34 private String description_en; 35 35 /** The affected primitives */ 36 private List<? extends OsmPrimitive> primitives;36 private Collection<? extends OsmPrimitive> primitives; 37 37 /** The primitives to be highlighted */ 38 private List<?> highlighted;38 private Collection<?> highlighted; 39 39 /** The tester that raised this error */ 40 40 private Test tester; … … 54 54 */ 55 55 public TestError(Test tester, Severity severity, String message, String description, String description_en, 56 int code, List<? extends OsmPrimitive> primitives, List<?> highlighted) {56 int code, Collection<? extends OsmPrimitive> primitives, Collection<?> highlighted) { 57 57 this.tester = tester; 58 58 this.severity = severity; … … 65 65 } 66 66 67 public TestError(Test tester, Severity severity, String message, int code, List<? extends OsmPrimitive> primitives,68 List<?> highlighted) {67 public TestError(Test tester, Severity severity, String message, int code, Collection<? extends OsmPrimitive> primitives, 68 Collection<?> highlighted) { 69 69 this(tester, severity, message, null, null, code, primitives, highlighted); 70 70 } 71 71 72 72 public TestError(Test tester, Severity severity, String message, String description, String description_en, 73 int code, List<? extends OsmPrimitive> primitives) {73 int code, Collection<? extends OsmPrimitive> primitives) { 74 74 this(tester, severity, message, description, description_en, code, primitives, primitives); 75 75 } 76 76 77 public TestError(Test tester, Severity severity, String message, int code, List<? extends OsmPrimitive> primitives) {77 public TestError(Test tester, Severity severity, String message, int code, Collection<? extends OsmPrimitive> primitives) { 78 78 this(tester, severity, message, null, null, code, primitives, primitives); 79 79 } … … 117 117 * @return the list of primitives affected by this error 118 118 */ 119 public List<? extends OsmPrimitive> getPrimitives() {119 public Collection<? extends OsmPrimitive> getPrimitives() { 120 120 return primitives; 121 121 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r3671 r3674 15 15 import java.util.List; 16 16 import java.util.Map; 17 import java.util.Set; 17 18 18 19 import javax.swing.JLabel; … … 33 34 import org.openstreetmap.josm.data.validation.Test; 34 35 import org.openstreetmap.josm.data.validation.TestError; 35 import org.openstreetmap.josm.data.validation.util.Bag;36 36 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 37 37 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 38 import org.openstreetmap.josm.tools.MultiMap; 38 39 39 40 /** … … 138 139 List<TestError> errors = new ArrayList<TestError>(); 139 140 140 Bag<Map<String,String>, OsmPrimitive> bag = new Bag<Map<String,String>, OsmPrimitive>();141 MultiMap<Map<String,String>, OsmPrimitive> mm = new MultiMap<Map<String,String>, OsmPrimitive>(); 141 142 for (Node n: nodes) { 142 bag.add(n.getKeys(), n);143 mm.put(n.getKeys(), n); 143 144 } 144 145 … … 150 151 // the same tag set 151 152 // 152 for (Iterator<Map<String,String>> it = bag.keySet().iterator(); it.hasNext();) {153 for (Iterator<Map<String,String>> it = mm.keySet().iterator(); it.hasNext();) { 153 154 Map<String,String> tagSet = it.next(); 154 if ( bag.get(tagSet).size() > 1) {155 if (mm.get(tagSet).size() > 1) { 155 156 156 157 for (String type: types) { … … 158 159 } 159 160 160 for (OsmPrimitive p : bag.get(tagSet)) {161 for (OsmPrimitive p : mm.get(tagSet)) { 161 162 if (p.getType()==OsmPrimitiveType.NODE) { 162 163 Node n = (Node) p; … … 198 199 msg, 199 200 DUPLICATE_NODE_MIXED, 200 bag.get(tagSet)201 mm.get(tagSet) 201 202 )); 202 203 } else if (typeMap.get("highway")) { … … 209 210 msg, 210 211 DUPLICATE_NODE_HIGHWAY, 211 bag.get(tagSet)212 mm.get(tagSet) 212 213 )); 213 214 } else if (typeMap.get("railway")) { … … 220 221 msg, 221 222 DUPLICATE_NODE_RAILWAY, 222 bag.get(tagSet)223 mm.get(tagSet) 223 224 )); 224 225 } else if (typeMap.get("waterway")) { … … 231 232 msg, 232 233 DUPLICATE_NODE_WATERWAY, 233 bag.get(tagSet)234 mm.get(tagSet) 234 235 )); 235 236 } else if (typeMap.get("boundary")) { … … 242 243 msg, 243 244 DUPLICATE_NODE_BOUNDARY, 244 bag.get(tagSet)245 mm.get(tagSet) 245 246 )); 246 247 } else if (typeMap.get("power")) { … … 253 254 msg, 254 255 DUPLICATE_NODE_POWER, 255 bag.get(tagSet)256 mm.get(tagSet) 256 257 )); 257 258 } else if (typeMap.get("natural")) { … … 264 265 msg, 265 266 DUPLICATE_NODE_NATURAL, 266 bag.get(tagSet)267 mm.get(tagSet) 267 268 )); 268 269 } else if (typeMap.get("building")) { … … 275 276 msg, 276 277 DUPLICATE_NODE_BUILDING, 277 bag.get(tagSet)278 mm.get(tagSet) 278 279 )); 279 280 } else if (typeMap.get("landuse")) { … … 286 287 msg, 287 288 DUPLICATE_NODE_LANDUSE, 288 bag.get(tagSet)289 mm.get(tagSet) 289 290 )); 290 291 } else { … … 297 298 msg, 298 299 DUPLICATE_NODE_OTHER, 299 bag.get(tagSet)300 mm.get(tagSet) 300 301 )); 301 302 … … 308 309 // differing tag sets 309 310 // 310 if (! bag.isEmpty()) {311 if (!mm.isEmpty()) { 311 312 List<OsmPrimitive> duplicates = new ArrayList<OsmPrimitive>(); 312 for ( List<OsmPrimitive> l: bag.values()) {313 for (Set<OsmPrimitive> l: mm.values()) { 313 314 duplicates.addAll(l); 314 315 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
r3671 r3674 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.util.ArrayList; 6 7 import java.util.Collection; 7 8 import java.util.HashSet; … … 9 10 import java.util.List; 10 11 import java.util.Map; 11 import java.util. Vector;12 import java.util.Set; 12 13 13 14 import org.openstreetmap.josm.command.ChangeCommand; … … 24 25 import org.openstreetmap.josm.data.validation.Test; 25 26 import org.openstreetmap.josm.data.validation.TestError; 26 import org.openstreetmap.josm.data.validation.util.Bag;27 27 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 28 import org.openstreetmap.josm.tools.MultiMap; 28 29 29 30 /** … … 36 37 public List<LatLon> coor; 37 38 public Map<String, String> keys; 38 public WayPair(List<LatLon> _coor, Map<String, String> _keys) {39 public WayPair(List<LatLon> _coor, Map<String, String> _keys) { 39 40 coor=_coor; 40 41 keys=_keys; … … 43 44 @Override 44 45 public int hashCode() { 45 return coor.hashCode() +keys.hashCode();46 return coor.hashCode() + keys.hashCode(); 46 47 } 47 48 … … 58 59 59 60 /** Bag of all ways */ 60 Bag<WayPair, OsmPrimitive> ways;61 MultiMap<WayPair, OsmPrimitive> ways; 61 62 62 63 /** … … 72 73 public void startTest(ProgressMonitor monitor) { 73 74 super.startTest(monitor); 74 ways = new Bag<WayPair, OsmPrimitive>(1000);75 ways = new MultiMap<WayPair, OsmPrimitive>(1000); 75 76 } 76 77 … … 78 79 public void endTest() { 79 80 super.endTest(); 80 for ( List<OsmPrimitive> duplicated : ways.values()) {81 for (Set<OsmPrimitive> duplicated : ways.values()) { 81 82 if (duplicated.size() > 1) { 82 83 TestError testError = new TestError(this, Severity.ERROR, tr("Duplicated ways"), DUPLICATE_WAY, duplicated); … … 91 92 if (!w.isUsable()) 92 93 return; 93 List<Node> wNodes =w.getNodes();94 Vector<LatLon> wLat=new Vector<LatLon>(wNodes.size());94 List<Node> wNodes = w.getNodes(); 95 List<LatLon> wLat = new ArrayList<LatLon>(wNodes.size()); 95 96 for (int i=0;i<wNodes.size();i++) { 96 97 wLat.add(wNodes.get(i).getCoor()); 97 98 } 98 Map<String, String> wkeys =w.getKeys();99 Map<String, String> wkeys = w.getKeys(); 99 100 wkeys.remove("created_by"); 100 WayPair wKey =new WayPair(wLat,wkeys);101 ways. add(wKey, w);101 WayPair wKey = new WayPair(wLat, wkeys); 102 ways.put(wKey, w); 102 103 } 103 104 -
trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
r3671 r3674 5 5 6 6 import java.util.ArrayList; 7 import java.util.Collection; 7 8 import java.util.HashMap; 9 import java.util.LinkedHashSet; 8 10 import java.util.List; 9 11 import java.util.Map; … … 17 19 import org.openstreetmap.josm.data.validation.Test; 18 20 import org.openstreetmap.josm.data.validation.TestError; 19 import org.openstreetmap.josm.data.validation.util.Bag;20 21 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 22 import org.openstreetmap.josm.tools.MultiMap; 21 23 import org.openstreetmap.josm.tools.Pair; 22 24 … … 29 31 30 32 /** Bag of all way segments */ 31 Bag<Pair<Node,Node>, WaySegment> nodePairs;33 MultiMap<Pair<Node,Node>, WaySegment> nodePairs; 32 34 33 35 protected static int OVERLAPPING_HIGHWAY = 101; … … 49 51 public void startTest(ProgressMonitor monitor) { 50 52 super.startTest(monitor); 51 nodePairs = new Bag<Pair<Node,Node>, WaySegment>(1000);53 nodePairs = new MultiMap<Pair<Node,Node>, WaySegment>(1000); 52 54 } 53 55 54 56 @Override 55 57 public void endTest() { 56 Map<List<Way>, Li st<WaySegment>> ways_seen = new HashMap<List<Way>, List<WaySegment>>(500);58 Map<List<Way>, LinkedHashSet<WaySegment>> ways_seen = new HashMap<List<Way>, LinkedHashSet<WaySegment>>(500); 57 59 58 for (Li st<WaySegment> duplicated : nodePairs.values()) {60 for (LinkedHashSet<WaySegment> duplicated : nodePairs.values()) { 59 61 int ways = duplicated.size(); 60 62 … … 62 64 List<OsmPrimitive> prims = new ArrayList<OsmPrimitive>(); 63 65 List<Way> current_ways = new ArrayList<Way>(); 64 List<WaySegment> highlight;66 Collection<WaySegment> highlight; 65 67 int highway = 0; 66 68 int railway = 0; … … 148 150 continue; 149 151 } 150 nodePairs. add(Pair.sort(new Pair<Node,Node>(lastN, n)),152 nodePairs.put(Pair.sort(new Pair<Node,Node>(lastN, n)), 151 153 new WaySegment(w, i)); 152 154 lastN = n; -
trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java
r3671 r3674 15 15 import org.openstreetmap.josm.data.validation.Test; 16 16 import org.openstreetmap.josm.data.validation.TestError; 17 import org.openstreetmap.josm.data.validation.util.Bag;18 17 import org.openstreetmap.josm.data.validation.util.ValUtil; 19 18 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 19 import org.openstreetmap.josm.tools.MultiMap; 20 import org.openstreetmap.josm.tools.Utils; 20 21 21 22 /** … … 32 33 Map<Point2D,List<Way>> cellWays; 33 34 /** The already detected errors */ 34 Bag<Way, Way> errorWays;35 MultiMap<Way, Way> errorWays; 35 36 36 37 /** … … 46 47 super.startTest(monitor); 47 48 cellWays = new HashMap<Point2D,List<Way>>(1000); 48 errorWays = new Bag<Way, Way>();49 errorWays = new MultiMap<Way, Way>(); 49 50 } 50 51 … … 83 84 primitives.add(w2); 84 85 errors.add(new TestError(this, Severity.WARNING, tr("Similarly named ways"), SIMILAR_NAMED, primitives)); 85 errorWays. add(w, w2);86 errorWays.put(w, w2); 86 87 } 87 88 } … … 142 143 143 144 // Step 6 144 d[i][j] = min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);145 d[i][j] = Utils.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost); 145 146 } 146 147 } … … 149 150 return d[n][m]; 150 151 } 151 152 /** // FIXME: move to utils153 * Get minimum of three values154 * @param a First value155 * @param b Second value156 * @param c Third value157 * @return The minimum of the three values158 */159 private static int min(int a, int b, int c) {160 int mi = a;161 if (b < mi) {162 mi = b;163 } if (c < mi) {164 mi = c;165 }166 return mi;167 }168 152 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r3673 r3674 24 24 import java.util.Map; 25 25 import java.util.Map.Entry; 26 import java.util.Set; 26 27 import java.util.regex.Matcher; 27 28 import java.util.regex.Pattern; … … 50 51 import org.openstreetmap.josm.data.validation.Test; 51 52 import org.openstreetmap.josm.data.validation.TestError; 52 import org.openstreetmap.josm.data.validation.util.Bag;53 53 import org.openstreetmap.josm.data.validation.util.Entities; 54 54 import org.openstreetmap.josm.data.validation.util.ValUtil; … … 59 59 import org.openstreetmap.josm.io.MirroredInputStream; 60 60 import org.openstreetmap.josm.tools.GBC; 61 import org.openstreetmap.josm.tools.MultiMap; 61 62 62 63 /** … … 75 76 protected static Map<String, String> spellCheckKeyData; 76 77 /** The spell check preset values */ 77 protected static Bag<String, String> presetsValueData;78 protected static MultiMap<String, String> presetsValueData; 78 79 /** The TagChecker data */ 79 80 protected static List<CheckerData> checkerData = new ArrayList<CheckerData>(); … … 294 295 Collection<TaggingPreset> presets = TaggingPresetPreference.taggingPresets; 295 296 if (presets != null) { 296 presetsValueData = new Bag<String, String>();297 presetsValueData = new MultiMap<String, String>(); 297 298 for (String a : OsmPrimitive.getUninterestingKeys()) { 298 presetsValueData. add(a);299 presetsValueData.putVoid(a); 299 300 } 300 301 // TODO directionKeys are no longer in OsmPrimitive (search pattern is used instead) … … 304 305 for (String a : Main.pref.getCollection(ValidatorPreference.PREFIX + ".knownkeys", 305 306 Arrays.asList(new String[]{"is_in", "int_ref", "fixme", "population"}))) { 306 presetsValueData. add(a);307 presetsValueData.putVoid(a); 307 308 } 308 309 for (TaggingPreset p : presets) { … … 312 313 if (combo.values != null) { 313 314 for(String value : combo.values.split(",")) { 314 presetsValueData. add(combo.key, value);315 presetsValueData.put(combo.key, value); 315 316 } 316 317 } 317 318 } else if (i instanceof TaggingPreset.Key) { 318 319 TaggingPreset.Key k = (TaggingPreset.Key) i; 319 presetsValueData. add(k.key, k.value);320 presetsValueData.put(k.key, k.value); 320 321 } else if (i instanceof TaggingPreset.Text) { 321 322 TaggingPreset.Text k = (TaggingPreset.Text) i; 322 presetsValueData. add(k.key);323 presetsValueData.putVoid(k.key); 323 324 } else if (i instanceof TaggingPreset.Check) { 324 325 TaggingPreset.Check k = (TaggingPreset.Check) i; 325 presetsValueData. add(k.key, "yes");326 presetsValueData. add(k.key, "no");326 presetsValueData.put(k.key, "yes"); 327 presetsValueData.put(k.key, "no"); 327 328 } 328 329 } … … 366 367 private void checkPrimitive(OsmPrimitive p) { 367 368 // Just a collection to know if a primitive has been already marked with error 368 Bag<OsmPrimitive, String> withErrors = new Bag<OsmPrimitive, String>();369 MultiMap<OsmPrimitive, String> withErrors = new MultiMap<OsmPrimitive, String>(); 369 370 370 371 if (checkComplex) { … … 400 401 errors.add( new TestError(this, Severity.ERROR, tr("Illegal tag/value combinations"), 401 402 tr("Illegal tag/value combinations"), tr("Illegal tag/value combinations"), 1272, p) ); 402 withErrors. add(p, "TC");403 withErrors.put(p, "TC"); 403 404 } 404 405 } … … 409 410 errors.add( new TestError(this, d.getSeverity(), tr("Illegal tag/value combinations"), 410 411 d.getDescription(), d.getDescriptionOrig(), d.getCode(), p) ); 411 withErrors. add(p, "TC");412 withErrors.put(p, "TC"); 412 413 } 413 414 } … … 422 423 errors.add( new TestError(this, Severity.WARNING, tr("Tag value contains character with code less than 0x20"), 423 424 tr(s, key), MessageFormat.format(s, key), LOW_CHAR_VALUE, p) ); 424 withErrors. add(p, "ICV");425 withErrors.put(p, "ICV"); 425 426 } 426 427 if (checkKeys && (containsLow(key)) && !withErrors.contains(p, "ICK")) { 427 428 errors.add( new TestError(this, Severity.WARNING, tr("Tag key contains character with code less than 0x20"), 428 429 tr(s, key), MessageFormat.format(s, key), LOW_CHAR_KEY, p) ); 429 withErrors. add(p, "ICK");430 withErrors.put(p, "ICK"); 430 431 } 431 432 if (checkValues && (value!=null && value.length() > 255) && !withErrors.contains(p, "LV")) { 432 433 errors.add( new TestError(this, Severity.ERROR, tr("Tag value longer than allowed"), 433 434 tr(s, key), MessageFormat.format(s, key), LONG_VALUE, p) ); 434 withErrors. add(p, "LV");435 withErrors.put(p, "LV"); 435 436 } 436 437 if (checkKeys && (key!=null && key.length() > 255) && !withErrors.contains(p, "LK")) { 437 438 errors.add( new TestError(this, Severity.ERROR, tr("Tag key longer than allowed"), 438 439 tr(s, key), MessageFormat.format(s, key), LONG_KEY, p) ); 439 withErrors. add(p, "LK");440 withErrors.put(p, "LK"); 440 441 } 441 442 if (checkValues && (value==null || value.trim().length() == 0) && !withErrors.contains(p, "EV")) { 442 443 errors.add( new TestError(this, Severity.WARNING, tr("Tags with empty values"), 443 444 tr(s, key), MessageFormat.format(s, key), EMPTY_VALUES, p) ); 444 withErrors. add(p, "EV");445 withErrors.put(p, "EV"); 445 446 } 446 447 if (checkKeys && spellCheckKeyData.containsKey(key) && !withErrors.contains(p, "IPK")) { 447 448 errors.add( new TestError(this, Severity.WARNING, tr("Invalid property key"), 448 449 tr(s, key), MessageFormat.format(s, key), INVALID_KEY, p) ); 449 withErrors. add(p, "IPK");450 withErrors.put(p, "IPK"); 450 451 } 451 452 if (checkKeys && key.indexOf(" ") >= 0 && !withErrors.contains(p, "IPK")) { 452 453 errors.add( new TestError(this, Severity.WARNING, tr("Invalid white space in property key"), 453 454 tr(s, key), MessageFormat.format(s, key), INVALID_KEY_SPACE, p) ); 454 withErrors. add(p, "IPK");455 withErrors.put(p, "IPK"); 455 456 } 456 457 if (checkValues && value != null && (value.startsWith(" ") || value.endsWith(" ")) && !withErrors.contains(p, "SPACE")) { 457 458 errors.add( new TestError(this, Severity.OTHER, tr("Property values start or end with white space"), 458 459 tr(s, key), MessageFormat.format(s, key), INVALID_SPACE, p) ); 459 withErrors. add(p, "SPACE");460 withErrors.put(p, "SPACE"); 460 461 } 461 462 if (checkValues && value != null && !value.equals(entities.unescape(value)) && !withErrors.contains(p, "HTML")) { 462 463 errors.add( new TestError(this, Severity.OTHER, tr("Property values contain HTML entity"), 463 464 tr(s, key), MessageFormat.format(s, key), INVALID_HTML, p) ); 464 withErrors. add(p, "HTML");465 withErrors.put(p, "HTML"); 465 466 } 466 467 if (checkValues && value != null && value.length() > 0 && presetsValueData != null) { 467 List<String> values = presetsValueData.get(key);468 Set<String> values = presetsValueData.get(key); 468 469 if (values == null) { 469 470 boolean ignore = false; … … 487 488 errors.add( new TestError(this, Severity.OTHER, tr("Presets do not contain property key"), 488 489 tr(i, key), MessageFormat.format(i, key), INVALID_VALUE, p) ); 489 withErrors. add(p, "UPK");490 withErrors.put(p, "UPK"); 490 491 } 491 492 } else if (values.size() > 0 && !values.contains(prop.getValue())) { … … 507 508 errors.add( new TestError(this, Severity.OTHER, tr("Presets do not contain property value"), 508 509 tr(i, prop.getValue(), key), MessageFormat.format(i, prop.getValue(), key), INVALID_VALUE, p) ); 509 withErrors. add(p, "UPV");510 withErrors.put(p, "UPV"); 510 511 } 511 512 } … … 518 519 errors.add(new TestError(this, Severity.OTHER, 519 520 tr("FIXMES"), FIXME, p)); 520 withErrors. add(p, "FIXME");521 withErrors.put(p, "FIXME"); 521 522 } 522 523 } … … 755 756 List<Command> commands = new ArrayList<Command>(50); 756 757 757 int i = -1; 758 List<? extends OsmPrimitive> primitives = testError.getPrimitives(); 758 Collection<? extends OsmPrimitive> primitives = testError.getPrimitives(); 759 759 for (OsmPrimitive p : primitives) { 760 i++;761 760 Map<String, String> tags = p.getKeys(); 762 761 if (tags == null || tags.isEmpty()) { … … 768 767 String value = prop.getValue(); 769 768 if (value == null || value.trim().length() == 0) { 770 commands.add(new ChangePropertyCommand(Collections.singleton(p rimitives.get(i)), key, null));769 commands.add(new ChangePropertyCommand(Collections.singleton(p), key, null)); 771 770 } else if (value.startsWith(" ") || value.endsWith(" ")) { 772 commands.add(new ChangePropertyCommand(Collections.singleton(p rimitives.get(i)), key, value.trim()));771 commands.add(new ChangePropertyCommand(Collections.singleton(p), key, value.trim())); 773 772 } else if (key.startsWith(" ") || key.endsWith(" ")) { 774 commands.add(new ChangePropertyKeyCommand(Collections.singleton(p rimitives.get(i)), key, key.trim()));773 commands.add(new ChangePropertyKeyCommand(Collections.singleton(p), key, key.trim())); 775 774 } else { 776 775 String evalue = entities.unescape(value); 777 776 if (!evalue.equals(value)) { 778 commands.add(new ChangePropertyCommand(Collections.singleton(p rimitives.get(i)), key, evalue));777 commands.add(new ChangePropertyCommand(Collections.singleton(p), key, evalue)); 779 778 } else { 780 779 String replacementKey = spellCheckKeyData.get(key); 781 780 if (replacementKey != null) { 782 commands.add(new ChangePropertyKeyCommand(Collections.singleton(p rimitives.get(i)),781 commands.add(new ChangePropertyKeyCommand(Collections.singleton(p), 783 782 key, replacementKey)); 784 783 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java
r3671 r3674 17 17 import org.openstreetmap.josm.data.validation.Test; 18 18 import org.openstreetmap.josm.data.validation.TestError; 19 import org.openstreetmap.josm.data.validation.util.Bag;20 19 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 21 20 … … 26 25 */ 27 26 public class UnclosedWays extends Test { 28 /** The already detected errors */29 protected Bag<Way, Way> errorWays;30 27 31 28 /** … … 39 36 public void startTest(ProgressMonitor monitor) { 40 37 super.startTest(monitor); 41 errorWays = new Bag<Way, Way>();42 38 } 43 39 44 40 @Override 45 41 public void endTest() { 46 errorWays = null;47 42 super.endTest(); 48 43 } … … 133 128 errors.add(new TestError(this, Severity.WARNING, tr("Unclosed way"), 134 129 type, etype, mode, primitives, highlight)); 135 errorWays.add(w, w);136 130 } 137 131 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/WronglyOrderedWays.java
r3673 r3674 12 12 import org.openstreetmap.josm.data.validation.Test; 13 13 import org.openstreetmap.josm.data.validation.TestError; 14 import org.openstreetmap.josm.data.validation.util.Bag;15 14 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 16 15 … … 26 25 protected static int WRONGLY_ORDERED_LAND = 1003; 27 26 28 /** The already detected errors */29 protected Bag<Way, Way> errorWays;30 31 27 /** 32 28 * Constructor … … 40 36 public void startTest(ProgressMonitor monitor) { 41 37 super.startTest(monitor); 42 errorWays = new Bag<Way, Way>();43 38 } 44 39 45 40 @Override 46 41 public void endTest() { 47 errorWays = null;48 42 super.endTest(); 49 43 } … … 96 90 primitives.add(w); 97 91 errors.add( new TestError(this, Severity.OTHER, errortype, type, primitives) ); 98 errorWays.add(w,w);99 92 } 100 93 }
Note:
See TracChangeset
for help on using the changeset viewer.