Changeset 18122 in osm for applications
- Timestamp:
- 2009-10-13T21:36:03+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/NodesWithSameName.java
r17722 r18122 6 6 import java.util.List; 7 7 import java.util.HashMap; 8 import java.util.HashSet; 8 9 import java.util.ArrayList; 9 10 … … 26 27 27 28 @Override public void startTest(ProgressMonitor monitor) { 28 29 super.startTest(monitor); 29 30 namesToNodes = new HashMap<String, List<Node>>(); 30 31 } … … 47 48 for (List<Node> nodes : namesToNodes.values()) { 48 49 if (nodes.size() > 1) { 49 errors.add(new TestError(this, Severity.OTHER, 50 tr("Nodes with same name"), SAME_NAME, nodes)); 50 // Report the same-name nodes, unless each has a unique ref=*. 51 HashSet<String> refs = new HashSet<String>(); 52 53 for (Node n : nodes) { 54 String ref = n.get("ref"); 55 if (ref == null || !refs.add(ref)) { 56 errors.add(new TestError(this, Severity.OTHER, 57 tr("Nodes with same name"), SAME_NAME, nodes)); 58 break; 59 } 60 } 51 61 } 52 62 }
Note:
See TracChangeset
for help on using the changeset viewer.