Changeset 5475 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-08-24T13:24:55+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r5380 r5475 83 83 protected static final List<String> ignoreDataEndsWith = new ArrayList<String>(); 84 84 protected static final List<IgnoreKeyPair> ignoreDataKeyPair = new ArrayList<IgnoreKeyPair>(); 85 protected static final List<IgnoreTwoKeyPair> ignoreDataTwoKeyPair = new ArrayList<IgnoreTwoKeyPair>();86 85 87 86 /** The preferences prefix */ … … 175 174 ignoreDataEndsWith.clear(); 176 175 ignoreDataKeyPair.clear(); 177 ignoreDataTwoKeyPair.clear();178 176 179 177 spellCheckKeyData = new HashMap<String, String>(); … … 249 247 tmp.value = line.substring(mid+1); 250 248 ignoreDataKeyPair.add(tmp); 251 } else if (key.equals("T:")) {252 IgnoreTwoKeyPair tmp = new IgnoreTwoKeyPair();253 int mid = line.indexOf("=");254 int split = line.indexOf("|");255 tmp.key1 = line.substring(0, mid);256 tmp.value1 = line.substring(mid+1, split);257 line = line.substring(split+1);258 mid = line.indexOf("=");259 tmp.key2 = line.substring(0, mid);260 tmp.value2 = line.substring(mid+1);261 ignoreDataTwoKeyPair.add(tmp);262 249 } 263 250 continue; … … 362 349 363 350 if (checkComplex) { 364 Map<String, String> props = (p.getKeys() == null) ? Collections.<String, String>emptyMap() : p.getKeys();365 for (Entry<String, String> prop : props.entrySet()) {366 boolean ignore = true;367 String key1 = prop.getKey();368 String value1 = prop.getValue();369 370 for (IgnoreTwoKeyPair a : ignoreDataTwoKeyPair) {371 if (key1.equals(a.key1) && value1.equals(a.value1)) {372 ignore = false;373 for (Entry<String, String> prop2 : props.entrySet()) {374 String key2 = prop2.getKey();375 String value2 = prop2.getValue();376 for (IgnoreTwoKeyPair b : ignoreDataTwoKeyPair) {377 if (key2.equals(b.key2) && value2.equals(b.value2)) {378 ignore = true;379 break;380 }381 }382 if (ignore) {383 break;384 }385 }386 }387 if (ignore) {388 break;389 }390 }391 392 if (!ignore) {393 errors.add( new TestError(this, Severity.OTHER, tr("Suspicious tag/value combinations"),394 tr("Suspicious tag/value combinations"), tr("Suspicious tag/value combinations"), 1272, p) );395 withErrors.put(p, "TC");396 }397 }398 399 351 Map<String, String> keys = p.getKeys(); 400 352 for (CheckerData d : checkerData) { … … 482 434 for (IgnoreKeyPair a : ignoreDataKeyPair) { 483 435 if (key.equals(a.key) && value.equals(a.value)) { 484 ignore = true;485 }486 }487 488 for (IgnoreTwoKeyPair a : ignoreDataTwoKeyPair) {489 if (key.equals(a.key2) && value.equals(a.value2)) {490 436 ignore = true; 491 437 } … … 801 747 } 802 748 803 protected static class IgnoreTwoKeyPair {804 public String key1;805 public String value1;806 public String key2;807 public String value2;808 }809 810 749 protected static class IgnoreKeyPair { 811 750 public String key;
Note:
See TracChangeset
for help on using the changeset viewer.