Changeset 6494 in josm
- Timestamp:
- 2013-12-18T19:13:16+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/validation/tests
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/BuildingInBuilding.java
r6240 r6494 188 188 } 189 189 } 190 191 primitivesToCheck.clear(); 192 index.clear(); 190 193 191 194 super.endTest(); -
trunk/src/org/openstreetmap/josm/data/validation/tests/DeprecatedTags.java
r6466 r6494 30 30 public class DeprecatedTags extends Test { 31 31 32 private List<DeprecationCheck> checks = new LinkedList<DeprecationCheck>(); 32 private final List<DeprecationCheck> checks = new LinkedList<DeprecationCheck>(); 33 33 34 34 /** -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
r6240 r6494 172 172 173 173 /** List of keys without useful information */ 174 private Collection<String> ignoreKeys = new HashSet<String>(OsmPrimitive.getUninterestingKeys());174 private final Set<String> ignoreKeys = new HashSet<String>(OsmPrimitive.getUninterestingKeys()); 175 175 176 176 /** -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
r6240 r6494 122 122 } 123 123 124 for(Set<OsmPrimitive> sameway : waysNoTags.values()) { 125 if (sameway.size() > 1) {124 for (Set<OsmPrimitive> sameway : waysNoTags.values()) { 125 if (sameway.size() > 1) { 126 126 //Report error only if at least some tags are different, as otherwise the error was already reported as duplicated ways 127 127 Map<String, String> tags0=null; 128 128 boolean skip=true; 129 129 130 for(OsmPrimitive o : sameway) { 130 for (OsmPrimitive o : sameway) { 131 131 if (tags0==null) { 132 132 tags0=o.getKeys(); -
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r6390 r6494 80 80 } 81 81 } 82 83 @Override 84 public void endTest() { 85 keysCheckedByAnotherTest.clear(); 86 super.endTest(); 87 } 82 88 83 89 private List<List<Node>> joinWays(Collection<Way> ways) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java
r6240 r6494 106 106 * @param selection The primitives to be tested 107 107 */ 108 @Override public void visit(Collection<OsmPrimitive> selection) { 109 for (OsmPrimitive p : selection) 108 @Override 109 public void visit(Collection<OsmPrimitive> selection) { 110 for (OsmPrimitive p : selection) { 110 111 if (!p.isDeleted() && !p.isIncomplete()) { 111 112 check(p); 112 113 } 114 } 113 115 } 114 116 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/NodesWithSameName.java
r6241 r6494 33 33 } 34 34 35 @Override public void startTest(ProgressMonitor monitor) { 35 @Override 36 public void startTest(ProgressMonitor monitor) { 36 37 super.startTest(monitor); 37 38 namesToNodes = new HashMap<String, List<Node>>(); 38 39 } 39 40 40 @Override public void visit(Node n) { 41 @Override 42 public void visit(Node n) { 41 43 if (!n.isUsable()) return; 42 44 … … 55 57 } 56 58 57 @Override public void endTest() { 59 @Override 60 public void endTest() { 58 61 for (List<Node> nodes : namesToNodes.values()) { 59 62 if (nodes.size() > 1) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
r6488 r6494 102 102 } 103 103 104 /** 105 * An error concerning invalid syntax for an "opening_hours"-like tag. 106 */ 104 107 public class OpeningHoursTestError { 105 108 final Severity severity; 106 109 final String message, prettifiedValue; 107 110 111 /** 112 * Constructs a new {@code OpeningHoursTestError} with a known pretiffied value. 113 * @param message The error message 114 * @param severity The error severity 115 * @param prettifiedValue The prettified value 116 */ 108 117 public OpeningHoursTestError(String message, Severity severity, String prettifiedValue) { 109 118 this.message = message; … … 112 121 } 113 122 123 /** 124 * Constructs a new {@code OpeningHoursTestError}. 125 * @param message The error message 126 * @param severity The error severity 127 */ 114 128 public OpeningHoursTestError(String message, Severity severity) { 115 129 this(message, severity, null); 116 130 } 117 131 132 /** 133 * Returns the real test error given to JOSM validator. 134 * @param p The incriminated OSM primitive. 135 * @param key The incriminated key, used for display. 136 * @return The real test error given to JOSM validator. Can be fixable or not if a prettified values has been determined. 137 */ 118 138 public TestError getTestError(final OsmPrimitive p, final String key) { 119 139 if (prettifiedValue == null) { … … 125 145 } 126 146 147 /** 148 * Returns the error message. 149 * @return The error message. 150 */ 127 151 public String getMessage() { 128 152 return message; 129 153 } 130 154 155 /** 156 * Returns the prettified value. 157 * @return The prettified value. 158 */ 131 159 public String getPrettifiedValue() { 132 160 return prettifiedValue; 133 161 } 134 162 163 /** 164 * Returns the error severity. 165 * @return The error severity. 166 */ 135 167 public Severity getSeverity() { 136 168 return severity; … … 172 204 } 173 205 206 /** 207 * Checks for a correct usage of the opening hour syntax of the {@code value} given, in time range mode, according to 208 * <a href="https://github.com/ypid/opening_hours.js">opening_hours.js</a> and returns a list containing 209 * validation errors or an empty list. Null values result in an empty list. 210 * @param key the OSM key (should be "opening_hours", "collection_times" or "service_times"). Used in error message 211 * @param value the opening hour value to be checked. 212 * @return a list of {@link TestError} or an empty list 213 */ 174 214 public List<OpeningHoursTestError> checkOpeningHourSyntax(final String key, final String value) { 175 215 return checkOpeningHourSyntax(key, value, CheckMode.TIME_RANGE); -
trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingAreas.java
r6241 r6494 25 25 26 26 protected static final int OVERLAPPING_AREAS = 2201; 27 protected QuadBuckets<Way> index = new QuadBuckets<Way>(); 27 protected final QuadBuckets<Way> index = new QuadBuckets<Way>(); 28 28 29 29 /** … … 93 93 } 94 94 } 95 96 index.clear(); 95 97 96 98 super.endTest(); -
trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
r6491 r6494 64 64 } 65 65 66 @SuppressWarnings("null")67 66 @Override 68 67 public void endTest() { -
trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java
r6475 r6494 25 25 import org.openstreetmap.josm.data.validation.Test; 26 26 import org.openstreetmap.josm.data.validation.TestError; 27 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 27 28 import org.openstreetmap.josm.tools.Geometry; 28 29 … … 96 97 97 98 @Override 99 public void startTest(ProgressMonitor progressMonitor) { 100 super.startTest(progressMonitor); 101 towerPoleTagMap.clear(); 102 powerStations.clear(); 103 potentialErrors.clear(); 104 } 105 106 @Override 98 107 public void endTest() { 99 108 for (PowerLineError e : potentialErrors) { … … 103 112 } 104 113 } 114 potentialErrors.clear(); 105 115 super.endTest(); 106 116 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r6482 r6494 72 72 public class TagChecker extends Test { 73 73 74 /** The default data files */ 74 /** The default data file of tagchecker rules */ 75 75 public static final String DATA_FILE = "resource://data/validator/tagchecker.cfg"; 76 /** The config file of ignored tags */ 76 77 public static final String IGNORE_FILE = "resource://data/validator/ignoretags.cfg"; 78 /** The config file of dictionary words */ 77 79 public static final String SPELL_FILE = "resource://data/validator/words.cfg"; 78 80 -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r6491 r6494 69 69 mindist = Main.pref.getDouble(PREFIX + ".node_way_distance", 10.0); 70 70 minmiddledist = Main.pref.getDouble(PREFIX + ".way_way_distance", 0.0); 71 this.dsArea = Main.main.getCurrentDataSet().getDataSourceArea();71 dsArea = Main.main.getCurrentDataSet().getDataSourceArea(); 72 72 } 73 73 … … 167 167 ways = null; 168 168 endnodes = null; 169 endnodes_highway = null; 170 middlenodes = null; 171 othernodes = null; 172 dsArea = null; 169 173 super.endTest(); 170 174 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java
r6400 r6494 24 24 * @author frsantos 25 25 */ 26 public class UntaggedWay extends Test 27 { 26 public class UntaggedWay extends Test { 27 28 28 /** Empty way error */ 29 29 protected static final int EMPTY_WAY = 301; -
trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java
r6241 r6494 43 43 } 44 44 } 45 if(!hasway) 46 { 45 if (!hasway) { 47 46 for (OsmPrimitive p : r) { 48 47 testForError(w, w.firstNode(), p); … … 57 56 } 58 57 } 59 if(!hasway) { 58 if (!hasway) { 60 59 for (OsmPrimitive p : r) { 61 60 testForError(w, w.lastNode(), p);
Note:
See TracChangeset
for help on using the changeset viewer.