Changeset 16436 in osm for applications/editors/josm/plugins/validator/src/org
- Timestamp:
- 2009-07-11T15:42:48+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java
r16319 r16436 79 79 protected static ArrayList<String> ignoreDataEndsWith = new ArrayList<String>(); 80 80 protected static ArrayList<IgnoreKeyPair> ignoreDataKeyPair = new ArrayList<IgnoreKeyPair>(); 81 protected static ArrayList<IgnoreTwoKeyPair> ignoreDataTwoKeyPair = new ArrayList<IgnoreTwoKeyPair>(); 81 82 82 83 /** The preferences prefix */ … … 253 254 ignoreDataKeyPair.add(tmp); 254 255 } 256 else if(key.equals("T:")) 257 { 258 IgnoreTwoKeyPair tmp = new IgnoreTwoKeyPair(); 259 int mid = line.indexOf("="); 260 int split = line.indexOf("|"); 261 tmp.key1 = line.substring(0, mid); 262 tmp.value1 = line.substring(mid+1, split); 263 line = line.substring(split+1); 264 mid = line.indexOf("="); 265 tmp.key2 = line.substring(0, mid); 266 tmp.value2 = line.substring(mid+1); 267 ignoreDataTwoKeyPair.add(tmp); 268 } 255 269 continue; 256 270 } … … 375 389 if(checkComplex) 376 390 { 391 Map<String, String> props = (p.keys == null) ? Collections.<String, String>emptyMap() : p.keys; 392 for(Entry<String, String> prop: props.entrySet() ) 393 { 394 boolean ignore = true; 395 String key1 = prop.getKey(); 396 String value1 = prop.getValue(); 397 398 for(IgnoreTwoKeyPair a : ignoreDataTwoKeyPair) 399 { 400 if(key1.equals(a.key1) && value1.equals(a.value1)) 401 { 402 ignore = false; 403 for(Entry<String, String> prop2: props.entrySet() ) 404 { 405 String key2 = prop2.getKey(); 406 String value2 = prop2.getValue(); 407 for(IgnoreTwoKeyPair b : ignoreDataTwoKeyPair) 408 { 409 if(key2.equals(b.key2) && value2.equals(b.value2)) 410 { 411 ignore = true; 412 break; 413 } 414 } 415 if(ignore) 416 break; 417 } 418 } 419 if(ignore) 420 break; 421 } 422 423 if(!ignore) 424 { 425 errors.add( new TestError(this, Severity.ERROR, tr("Illegal tag/value combinations"), 426 tr("Illegal tag/value combinations"), tr("Illegal tag/value combinations"), 1272, p) ); 427 withErrors.add(p, "TC"); 428 } 429 } 430 377 431 for(CheckerData d : checkerData) 378 432 { … … 469 523 { 470 524 if(key.equals(a.key) && value.equals(a.value)) 525 ignore = true; 526 } 527 528 for(IgnoreTwoKeyPair a : ignoreDataTwoKeyPair) 529 { 530 if(key.equals(a.key2) && value.equals(a.value2)) 471 531 ignore = true; 472 532 } … … 778 838 } 779 839 840 private static class IgnoreTwoKeyPair { 841 public String key1; 842 public String value1; 843 public String key2; 844 public String value2; 845 } 846 780 847 private static class IgnoreKeyPair { 781 848 public String key;
Note:
See TracChangeset
for help on using the changeset viewer.