Changeset 4869 in josm for trunk/src/org/openstreetmap/josm/data/validation
- Timestamp:
- 2012-01-24T21:52:43+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/validation
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r4682 r4869 72 72 public static double griddetail; 73 73 74 public static Collection<String> ignoredErrors = new TreeSet<String>();74 public static final Collection<String> ignoredErrors = new TreeSet<String>(); 75 75 76 76 /** -
trunk/src/org/openstreetmap/josm/data/validation/tests/BuildingInBuilding.java
r4806 r4869 24 24 public class BuildingInBuilding extends Test { 25 25 26 protected static int BUILDING_INSIDE_BUILDING = 2001;26 protected static final int BUILDING_INSIDE_BUILDING = 2001; 27 27 protected List<OsmPrimitive> primitivesToCheck = new LinkedList<OsmPrimitive>(); 28 28 protected QuadBuckets<Way> index = new QuadBuckets<Way>(); … … 57 57 // Check that all nodes of w are in polygon 58 58 for (Node n : w.getNodes()) { 59 if (!isInPolygon(n, polygon)) {59 if (!isInPolygon(n, polygon)) 60 60 return false; 61 }62 61 } 63 62 // All nodes can be inside polygon and still, w outside: … … 73 72 for (int i=1; i<w.getNodesCount(); i++) { 74 73 LatLon center = w.getNode(i).getCoor().getCenter(w.getNode(i-1).getCoor()); 75 if (center != null && !isInPolygon(new Node(center), polygon)) {74 if (center != null && !isInPolygon(new Node(center), polygon)) 76 75 return false; 77 }78 76 } 79 77 return true; … … 86 84 @Override 87 85 public boolean evaluate(Way object) { 88 if (p.equals(object)) {86 if (p.equals(object)) 89 87 return false; 90 } else if (p instanceof Node) {88 else if (p instanceof Node) 91 89 return isInPolygon((Node) p, object.getNodes()) || object.getNodes().contains(p); 92 } else if (p instanceof Way) {90 else if (p instanceof Way) 93 91 return isInPolygon((Way) p, object.getNodes()) && !isInInnerWay((Way)p, object); 94 } else {92 else 95 93 return false; 96 }97 94 } 98 95 }); … … 103 100 } 104 101 } 105 102 106 103 private boolean isInInnerWay(Way w, Way outer) { 107 104 for (OsmPrimitive r : outer.getReferrers()) { … … 113 110 if (isInPolygon(inner, outer.getNodes())) { 114 111 // If the tested way is inside this inner, outer is a false positive 115 if (isInPolygon(w, inner.getNodes())) {112 if (isInPolygon(w, inner.getNodes())) 116 113 return true; 117 }118 114 } 119 115 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java
r4806 r4869 31 31 public class Coastlines extends Test { 32 32 33 protected static int UNORDERED_COASTLINE = 901;34 protected static int REVERSED_COASTLINE = 902;35 protected static int UNCONNECTED_COASTLINE = 903;33 protected static final int UNORDERED_COASTLINE = 901; 34 protected static final int REVERSED_COASTLINE = 902; 35 protected static final int UNCONNECTED_COASTLINE = 903; 36 36 37 37 private List<Way> coastlines; -
trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
r4806 r4869 29 29 */ 30 30 public class CrossingWays extends Test { 31 protected static int CROSSING_WAYS = 601;31 protected static final int CROSSING_WAYS = 601; 32 32 33 33 /** All way segments, grouped by cells */ … … 43 43 public CrossingWays() { 44 44 super(tr("Crossing ways"), 45 tr("This test checks if two roads, railways, waterways or buildings crosses in the same layer, but are not connected by a node."));45 tr("This test checks if two roads, railways, waterways or buildings crosses in the same layer, but are not connected by a node.")); 46 46 } 47 47 … … 82 82 83 83 String layer1 = w.get("layer"); 84 if ("0".equals(layer1)) layer1 = null; //0 is default value 84 if ("0".equals(layer1)) { 85 layer1 = null; //0 is default value 86 } 85 87 86 88 int nodesSize = w.getNodesCount(); … … 94 96 List<WaySegment> highlight; 95 97 96 if (errorSegments.contains(ws) && errorSegments.contains(es2.ws)) 97 continue; 98 if (errorSegments.contains(ws) && errorSegments.contains(es2.ws)) { 99 continue; 100 } 98 101 99 102 String layer2 = es2.layer; 100 103 String railway2 = es2.railway; 101 104 boolean isCoastline2 = es2.coastline; 102 if (layer1 == null ? layer2 != null : !layer1.equals(layer2)) 103 continue; 104 105 if (!es1.intersects(es2) ) continue; 106 if (isSubway1 && "subway".equals(railway2)) continue; 107 if (isTram1 && "tram".equals(railway2)) continue; 108 109 if (isCoastline1 != isCoastline2) continue; 105 if (layer1 == null ? layer2 != null : !layer1.equals(layer2)) { 106 continue; 107 } 108 109 if (!es1.intersects(es2) ) { 110 continue; 111 } 112 if (isSubway1 && "subway".equals(railway2)) { 113 continue; 114 } 115 if (isTram1 && "tram".equals(railway2)) { 116 continue; 117 } 118 119 if (isCoastline1 != isCoastline2) { 120 continue; 121 } 110 122 if (("river".equals(waterway1) && "riverbank".equals(es2.waterway)) 111 || ("riverbank".equals(waterway1) && "river".equals(es2.waterway))) continue; 123 || ("riverbank".equals(waterway1) && "river".equals(es2.waterway))) { 124 continue; 125 } 112 126 113 127 if ((es1.railway != null && es1.railway.equals("abandoned")) 114 || (railway2 != null && railway2.equals("abandoned"))) continue; 128 || (railway2 != null && railway2.equals("abandoned"))) { 129 continue; 130 } 115 131 116 132 prims = Arrays.asList(es1.ws.way, es2.ws.way); … … 131 147 132 148 errors.add(new TestError(this, Severity.WARNING, 133 message,134 CROSSING_WAYS,135 prims,136 highlight));149 message, 150 CROSSING_WAYS, 151 prims, 152 highlight)); 137 153 ways_seen.put(prims, highlight); 138 154 } else { … … 147 163 148 164 /** 149 * Returns all the cells this segment crosses. Each cell contains the list150 * of segments already processed151 *152 * @param n1 The first node153 * @param n2 The second node154 * @return A list with all the cells the segment crosses155 */165 * Returns all the cells this segment crosses. Each cell contains the list 166 * of segments already processed 167 * 168 * @param n1 The first node 169 * @param n2 The second node 170 * @return A list with all the cells the segment crosses 171 */ 156 172 public List<List<ExtendedSegment>> getSegments(Node n1, Node n2) { 157 173 … … 218 234 219 235 return Line2D.linesIntersect( 220 n1.getEastNorth().east(), n1.getEastNorth().north(),221 n2.getEastNorth().east(), n2.getEastNorth().north(),222 s2.n1.getEastNorth().east(), s2.n1.getEastNorth().north(),223 s2.n2.getEastNorth().east(), s2.n2.getEastNorth().north());236 n1.getEastNorth().east(), n1.getEastNorth().north(), 237 n2.getEastNorth().east(), n2.getEastNorth().north(), 238 s2.n1.getEastNorth().east(), s2.n1.getEastNorth().north(), 239 s2.n2.getEastNorth().east(), s2.n2.getEastNorth().north()); 224 240 } 225 241 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r4806 r4869 5 5 import static org.openstreetmap.josm.tools.I18n.tr; 6 6 7 import java.awt.GridBagLayout;8 import java.awt.geom.Area;9 7 import java.util.ArrayList; 10 8 import java.util.Collection; … … 16 14 import java.util.Map; 17 15 import java.util.Set; 18 19 import javax.swing.JLabel;20 import javax.swing.JOptionPane;21 import javax.swing.JPanel;22 16 23 17 import org.openstreetmap.josm.Main; … … 35 29 import org.openstreetmap.josm.data.validation.Test; 36 30 import org.openstreetmap.josm.data.validation.TestError; 37 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;38 31 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 39 32 import org.openstreetmap.josm.tools.MultiMap; … … 54 47 Math.round(o.getCoor().lat() / precision) * precision, 55 48 Math.round(o.getCoor().lon() / precision) * precision 56 );49 ); 57 50 } 58 51 … … 82 75 } 83 76 84 protected static int DUPLICATE_NODE = 1;85 protected static int DUPLICATE_NODE_MIXED = 2;86 protected static int DUPLICATE_NODE_OTHER = 3;87 protected static int DUPLICATE_NODE_UNCLOSED = 4;88 protected static int DUPLICATE_NODE_BUILDING = 10;89 protected static int DUPLICATE_NODE_BOUNDARY = 11;90 protected static int DUPLICATE_NODE_HIGHWAY = 12;91 protected static int DUPLICATE_NODE_LANDUSE = 13;92 protected static int DUPLICATE_NODE_NATURAL = 14;93 protected static int DUPLICATE_NODE_POWER = 15;94 protected static int DUPLICATE_NODE_RAILWAY = 16;95 protected static int DUPLICATE_NODE_WATERWAY = 17;77 protected final static int DUPLICATE_NODE = 1; 78 protected final static int DUPLICATE_NODE_MIXED = 2; 79 protected final static int DUPLICATE_NODE_OTHER = 3; 80 protected final static int DUPLICATE_NODE_UNCLOSED = 4; 81 protected final static int DUPLICATE_NODE_BUILDING = 10; 82 protected final static int DUPLICATE_NODE_BOUNDARY = 11; 83 protected final static int DUPLICATE_NODE_HIGHWAY = 12; 84 protected final static int DUPLICATE_NODE_LANDUSE = 13; 85 protected final static int DUPLICATE_NODE_NATURAL = 14; 86 protected final static int DUPLICATE_NODE_POWER = 15; 87 protected final static int DUPLICATE_NODE_RAILWAY = 16; 88 protected final static int DUPLICATE_NODE_WATERWAY = 17; 96 89 97 90 /** The map of potential duplicates. … … 204 197 DUPLICATE_NODE_UNCLOSED, 205 198 mm.get(tagSet) 206 ));199 )); 207 200 } else if (nbType>1) { 208 201 String msg = marktr("Mixed type duplicated nodes"); … … 215 208 DUPLICATE_NODE_MIXED, 216 209 mm.get(tagSet) 217 ));210 )); 218 211 } else if (typeMap.get("highway")) { 219 212 String msg = marktr("Highway duplicated nodes"); … … 226 219 DUPLICATE_NODE_HIGHWAY, 227 220 mm.get(tagSet) 228 ));221 )); 229 222 } else if (typeMap.get("railway")) { 230 223 String msg = marktr("Railway duplicated nodes"); … … 237 230 DUPLICATE_NODE_RAILWAY, 238 231 mm.get(tagSet) 239 ));232 )); 240 233 } else if (typeMap.get("waterway")) { 241 234 String msg = marktr("Waterway duplicated nodes"); … … 248 241 DUPLICATE_NODE_WATERWAY, 249 242 mm.get(tagSet) 250 ));243 )); 251 244 } else if (typeMap.get("boundary")) { 252 245 String msg = marktr("Boundary duplicated nodes"); … … 259 252 DUPLICATE_NODE_BOUNDARY, 260 253 mm.get(tagSet) 261 ));254 )); 262 255 } else if (typeMap.get("power")) { 263 256 String msg = marktr("Power duplicated nodes"); … … 270 263 DUPLICATE_NODE_POWER, 271 264 mm.get(tagSet) 272 ));265 )); 273 266 } else if (typeMap.get("natural")) { 274 267 String msg = marktr("Natural duplicated nodes"); … … 281 274 DUPLICATE_NODE_NATURAL, 282 275 mm.get(tagSet) 283 ));276 )); 284 277 } else if (typeMap.get("building")) { 285 278 String msg = marktr("Building duplicated nodes"); … … 292 285 DUPLICATE_NODE_BUILDING, 293 286 mm.get(tagSet) 294 ));287 )); 295 288 } else if (typeMap.get("landuse")) { 296 289 String msg = marktr("Landuse duplicated nodes"); … … 303 296 DUPLICATE_NODE_LANDUSE, 304 297 mm.get(tagSet) 305 ));298 )); 306 299 } else { 307 300 String msg = marktr("Other duplicated nodes"); … … 314 307 DUPLICATE_NODE_OTHER, 315 308 mm.get(tagSet) 316 ));309 )); 317 310 318 311 } … … 336 329 DUPLICATE_NODE, 337 330 duplicates 338 ));331 )); 339 332 } 340 333 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
r4806 r4869 122 122 } 123 123 124 protected static int DUPLICATE_RELATION = 1901;125 protected static int SAME_RELATION = 1902;124 protected static final int DUPLICATE_RELATION = 1901; 125 protected static final int SAME_RELATION = 1902; 126 126 127 127 /** MultiMap of all relations */ -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
r4806 r4869 73 73 } 74 74 75 protected static int DUPLICATE_WAY = 1401;76 protected static int SAME_WAY = 1402;75 protected static final int DUPLICATE_WAY = 1401; 76 protected static final int SAME_WAY = 1402; 77 77 78 78 /** Bag of all ways */ … … 87 87 public DuplicateWay() { 88 88 super(tr("Duplicated ways"), 89 tr("This test checks that there are no ways with same node coordinates and optionally also same tags."));89 tr("This test checks that there are no ways with same node coordinates and optionally also same tags.")); 90 90 } 91 91 … … 127 127 } 128 128 } 129 if (skip) continue; 129 if (skip) { 130 continue; 131 } 130 132 TestError testError = new TestError(this, Severity.WARNING, tr("Ways with same position"), SAME_WAY, sameway); 131 133 errors.add(testError); … … 137 139 138 140 /** 139 * Remove uninteresting keys, like created_by to normalize the tags 141 * Remove uninteresting keys, like created_by to normalize the tags 140 142 */ 141 143 public void removeUninterestingKeys(Map<String, String> wkeys) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicatedWayNodes.java
r4806 r4869 18 18 19 19 public class DuplicatedWayNodes extends Test { 20 protected static int DUPLICATE_WAY_NODE = 501;20 protected static final int DUPLICATE_WAY_NODE = 501; 21 21 22 22 public DuplicatedWayNodes() { 23 23 super(tr("Duplicated way nodes"), 24 tr("Checks for ways with identical consecutive nodes."));24 tr("Checks for ways with identical consecutive nodes.")); 25 25 } 26 26 … … 37 37 if (lastN == n) { 38 38 errors.add(new TestError(this, Severity.ERROR, tr("Duplicated way nodes"), DUPLICATE_WAY_NODE, 39 Arrays.asList(w), Arrays.asList(n)));39 Arrays.asList(w), Arrays.asList(n))); 40 40 break; 41 41 } … … 59 59 lastN = n; 60 60 } 61 if (wnew.getNodesCount() < 2) {61 if (wnew.getNodesCount() < 2) 62 62 // Empty way, delete 63 63 return DeleteCommand.delete(Main.map.mapView.getEditLayer(), Collections.singleton(w)); 64 } else {64 else 65 65 return new ChangeCommand(w, wnew); 66 }67 66 } 68 67 -
trunk/src/org/openstreetmap/josm/data/validation/tests/NodesWithSameName.java
r3671 r4869 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.util.Map; 7 import java.util.List; 6 import java.util.ArrayList; 8 7 import java.util.HashMap; 9 8 import java.util.HashSet; 10 import java.util.ArrayList; 9 import java.util.List; 10 import java.util.Map; 11 11 12 12 import org.openstreetmap.josm.data.osm.Node; … … 17 17 18 18 public class NodesWithSameName extends Test { 19 protected static int SAME_NAME = 801;19 protected static final int SAME_NAME = 801; 20 20 21 21 private Map<String, List<Node>> namesToNodes; … … 23 23 public NodesWithSameName() { 24 24 super(tr("Nodes with same name"), 25 tr("This test finds nodes that have the same name (might be duplicates)."));25 tr("This test finds nodes that have the same name (might be duplicates).")); 26 26 } 27 27 -
trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingAreas.java
r4806 r4869 5 5 import java.util.Collection; 6 6 import java.util.Collections; 7 7 8 import org.openstreetmap.josm.data.osm.QuadBuckets; 8 9 import org.openstreetmap.josm.data.osm.Way; … … 17 18 public class OverlappingAreas extends Test { 18 19 19 protected static int OVERLAPPING_AREAS = 2201;20 protected static final int OVERLAPPING_AREAS = 2201; 20 21 protected QuadBuckets<Way> index = new QuadBuckets<Way>(); 21 22 … … 40 41 @Override 41 42 public boolean evaluate(Way wi) { 42 if (w.equals(wi)) {43 if (w.equals(wi)) 43 44 return false; 44 } else {45 else 45 46 return Geometry.polygonIntersection(w.getNodes(), wi.getNodes()) 46 47 == Geometry.PolygonIntersection.CROSSING; 47 }48 48 } 49 49 }); -
trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
r4806 r4869 29 29 */ 30 30 public class OverlappingWays extends Test { 31 31 32 32 /** Bag of all way segments */ 33 33 MultiMap<Pair<Node,Node>, WaySegment> nodePairs; 34 34 35 protected static int OVERLAPPING_HIGHWAY = 101;36 protected static int OVERLAPPING_RAILWAY = 102;37 protected static int OVERLAPPING_WAY = 103;38 protected static int OVERLAPPING_HIGHWAY_AREA = 111;39 protected static int OVERLAPPING_RAILWAY_AREA = 112;40 protected static int OVERLAPPING_WAY_AREA = 113;41 protected static int OVERLAPPING_AREA = 120;35 protected static final int OVERLAPPING_HIGHWAY = 101; 36 protected static final int OVERLAPPING_RAILWAY = 102; 37 protected static final int OVERLAPPING_WAY = 103; 38 protected static final int OVERLAPPING_HIGHWAY_AREA = 111; 39 protected static final int OVERLAPPING_RAILWAY_AREA = 112; 40 protected static final int OVERLAPPING_WAY_AREA = 113; 41 protected static final int OVERLAPPING_AREA = 120; 42 42 43 43 /** Constructor */ 44 44 public OverlappingWays() { 45 45 super(tr("Overlapping ways"), 46 tr("This test checks that a connection between two nodes "47 + "is not used by more than one way."));46 tr("This test checks that a connection between two nodes " 47 + "is not used by more than one way.")); 48 48 } 49 49 … … 125 125 } 126 126 127 errors.add(new TestError(this, 127 errors.add(new TestError(this, 128 128 type < OVERLAPPING_HIGHWAY_AREA ? Severity.WARNING : Severity.OTHER, 129 errortype, type, prims, duplicated));129 errortype, type, prims, duplicated)); 130 130 ways_seen.put(current_ways, duplicated); 131 131 } else { /* way seen, mark highlight layer only */ … … 151 151 } 152 152 nodePairs.put(Pair.sort(new Pair<Node,Node>(lastN, n)), 153 new WaySegment(w, i));153 new WaySegment(w, i)); 154 154 lastN = n; 155 155 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
r4806 r4869 28 28 public class RelationChecker extends Test { 29 29 30 protected static int ROLE_UNKNOWN = 1701;31 protected static int ROLE_EMPTY = 1702;32 protected static int WRONG_TYPE = 1703;33 protected static int HIGH_COUNT = 1704;34 protected static int LOW_COUNT = 1705;35 protected static int ROLE_MISSING = 1706;36 protected static int RELATION_UNKNOWN = 1707;37 protected static int RELATION_EMPTY = 1708;30 protected static final int ROLE_UNKNOWN = 1701; 31 protected static final int ROLE_EMPTY = 1702; 32 protected static final int WRONG_TYPE = 1703; 33 protected static final int HIGH_COUNT = 1704; 34 protected static final int LOW_COUNT = 1705; 35 protected static final int ROLE_MISSING = 1706; 36 protected static final int RELATION_UNKNOWN = 1707; 37 protected static final int RELATION_EMPTY = 1708; 38 38 39 39 /** -
trunk/src/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWay.java
r3671 r4869 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.util.Arrays; 6 7 import java.util.HashSet; 7 import java.util.Arrays;8 8 9 import org.openstreetmap.josm.data.osm.Node; 9 10 import org.openstreetmap.josm.data.osm.Way; 10 import org.openstreetmap.josm.data.osm.Node;11 11 import org.openstreetmap.josm.data.validation.Severity; 12 12 import org.openstreetmap.josm.data.validation.Test; … … 17 17 */ 18 18 public class SelfIntersectingWay extends Test { 19 20 protected static int SELF_INTERSECT = 401;19 20 protected static final int SELF_INTERSECT = 401; 21 21 22 22 public SelfIntersectingWay() { 23 23 super(tr("Self-intersecting ways"), 24 tr("This test checks for ways " +25 "that contain some of their nodes more than once."));24 tr("This test checks for ways " + 25 "that contain some of their nodes more than once.")); 26 26 } 27 27 … … 33 33 if (nodes.contains(n)) { 34 34 errors.add(new TestError(this, 35 Severity.WARNING, tr("Self-intersecting ways"), SELF_INTERSECT,36 Arrays.asList(w), Arrays.asList(n)));35 Severity.WARNING, tr("Self-intersecting ways"), SELF_INTERSECT, 36 Arrays.asList(w), Arrays.asList(n))); 37 37 break; 38 38 } else { -
trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java
r4806 r4869 28 28 public class SimilarNamedWays extends Test { 29 29 30 protected static int SIMILAR_NAMED = 701;30 protected static final int SIMILAR_NAMED = 701; 31 31 32 32 /** All ways, grouped by cells */ -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r4812 r4869 49 49 import org.openstreetmap.josm.data.osm.Relation; 50 50 import org.openstreetmap.josm.data.osm.Way; 51 import org.openstreetmap.josm.data.validation.OsmValidator;52 51 import org.openstreetmap.josm.data.validation.Severity; 53 52 import org.openstreetmap.josm.data.validation.Test; 54 53 import org.openstreetmap.josm.data.validation.TestError; 55 54 import org.openstreetmap.josm.data.validation.util.Entities; 55 import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference; 56 56 import org.openstreetmap.josm.gui.preferences.ValidatorPreference; 57 import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference;58 57 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 59 58 import org.openstreetmap.josm.gui.tagging.TaggingPreset; … … 79 78 protected static MultiMap<String, String> presetsValueData; 80 79 /** The TagChecker data */ 81 protected static List<CheckerData> checkerData = new ArrayList<CheckerData>();82 protected static List<String> ignoreDataStartsWith = new ArrayList<String>();83 protected static List<String> ignoreDataEquals = new ArrayList<String>();84 protected static List<String> ignoreDataEndsWith = new ArrayList<String>();85 protected static List<IgnoreKeyPair> ignoreDataKeyPair = new ArrayList<IgnoreKeyPair>();86 protected static List<IgnoreTwoKeyPair> ignoreDataTwoKeyPair = new ArrayList<IgnoreTwoKeyPair>();80 protected static final List<CheckerData> checkerData = new ArrayList<CheckerData>(); 81 protected static final List<String> ignoreDataStartsWith = new ArrayList<String>(); 82 protected static final List<String> ignoreDataEquals = new ArrayList<String>(); 83 protected static final List<String> ignoreDataEndsWith = new ArrayList<String>(); 84 protected static final List<IgnoreKeyPair> ignoreDataKeyPair = new ArrayList<IgnoreKeyPair>(); 85 protected static final List<IgnoreTwoKeyPair> ignoreDataTwoKeyPair = new ArrayList<IgnoreTwoKeyPair>(); 87 86 88 87 /** The preferences prefix */ … … 129 128 protected JButton deleteSrcButton; 130 129 131 protected static int EMPTY_VALUES = 1200;132 protected static int INVALID_KEY = 1201;133 protected static int INVALID_VALUE = 1202;134 protected static int FIXME = 1203;135 protected static int INVALID_SPACE = 1204;136 protected static int INVALID_KEY_SPACE = 1205;137 protected static int INVALID_HTML = 1206; /* 1207 was PAINT */138 protected static int LONG_VALUE = 1208;139 protected static int LONG_KEY = 1209;140 protected static int LOW_CHAR_VALUE = 1210;141 protected static int LOW_CHAR_KEY = 1211;130 protected static final int EMPTY_VALUES = 1200; 131 protected static final int INVALID_KEY = 1201; 132 protected static final int INVALID_VALUE = 1202; 133 protected static final int FIXME = 1203; 134 protected static final int INVALID_SPACE = 1204; 135 protected static final int INVALID_KEY_SPACE = 1205; 136 protected static final int INVALID_HTML = 1206; /* 1207 was PAINT */ 137 protected static final int LONG_VALUE = 1208; 138 protected static final int LONG_KEY = 1209; 139 protected static final int LOW_CHAR_VALUE = 1210; 140 protected static final int LOW_CHAR_KEY = 1211; 142 141 /** 1250 and up is used by tagcheck */ 143 142 … … 145 144 protected JList sourcesList; 146 145 147 protected static Entities entities = new Entities();146 protected static final Entities entities = new Entities(); 148 147 149 148 /** … … 626 625 tr("Information"), 627 626 JOptionPane.INFORMATION_MESSAGE 628 );627 ); 629 628 } 630 629 } else { … … 713 712 public void handlePrefEnable() { 714 713 boolean selected = prefCheckKeys.isSelected() || prefCheckKeysBeforeUpload.isSelected() 715 714 || prefCheckComplex.isSelected() || prefCheckComplexBeforeUpload.isSelected(); 716 715 sourcesList.setEnabled( selected ); 717 716 addSrcButton.setEnabled(selected); … … 792 791 if (commands.size() == 1) 793 792 return commands.get(0); 794 793 795 794 return new SequenceCommand(tr("Fix properties"), commands); 796 795 } … … 825 824 private int code; 826 825 protected Severity severity; 827 protected static int TAG_CHECK_ERROR = 1250;828 protected static int TAG_CHECK_WARN = 1260;829 protected static int TAG_CHECK_INFO = 1270;826 protected static final int TAG_CHECK_ERROR = 1250; 827 protected static final int TAG_CHECK_WARN = 1260; 828 protected static final int TAG_CHECK_INFO = 1270; 830 829 831 830 private static class CheckerElement { -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r4806 r4869 39 39 public class UnconnectedWays extends Test { 40 40 41 protected static int UNCONNECTED_WAYS = 1301;41 protected static final int UNCONNECTED_WAYS = 1301; 42 42 protected static final String PREFIX = ValidatorPreference.PREFIX + "." + UnconnectedWays.class.getSimpleName(); 43 43 … … 314 314 public boolean isArea() { 315 315 return w.hasKey("landuse") 316 || w.hasKey("leisure")317 || w.hasKey("amenity")318 || w.hasKey("building");316 || w.hasKey("leisure") 317 || w.hasKey("amenity") 318 || w.hasKey("building"); 319 319 } 320 320 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/WronglyOrderedWays.java
r4806 r4869 19 19 public class WronglyOrderedWays extends Test { 20 20 21 protected static int WRONGLY_ORDERED_COAST = 1001;21 protected static final int WRONGLY_ORDERED_COAST = 1001; 22 22 //protected static int WRONGLY_ORDERED_WATER = 1002; 23 protected static int WRONGLY_ORDERED_LAND = 1003;23 protected static final int WRONGLY_ORDERED_LAND = 1003; 24 24 25 25 /** … … 28 28 public WronglyOrderedWays() { 29 29 super(tr("Wrongly Ordered Ways"), 30 tr("This test checks the direction of water, land and coastline ways."));30 tr("This test checks the direction of water, land and coastline ways.")); 31 31 } 32 32 … … 38 38 39 39 String natural = w.get("natural"); 40 if (natural == null) {40 if (natural == null) 41 41 return; 42 }else if ("coastline".equals(natural) && Geometry.isClockwise(w)) {42 else if ("coastline".equals(natural) && Geometry.isClockwise(w)) { 43 43 reportError(w, tr("Reversed coastline: land not on left side"), WRONGLY_ORDERED_COAST); 44 /*} else if ("water".equals(natural) && !Geometry.isClockwise(w)) {44 /*} else if ("water".equals(natural) && !Geometry.isClockwise(w)) { 45 45 reportError(w, tr("Reversed water: land not on left side"), WRONGLY_ORDERED_WATER);*/ 46 46 } else if ("land".equals(natural) && Geometry.isClockwise(w)) { 47 47 reportError(w, tr("Reversed land: land not on left side"), WRONGLY_ORDERED_LAND); 48 } else {48 } else 49 49 return; 50 }51 50 52 51 }
Note:
See TracChangeset
for help on using the changeset viewer.