Changeset 15998 in josm
- Timestamp:
- 2020-03-02T22:19:23+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r15997 r15998 379 379 380 380 Selector whichSelectorMatchesEnvironment(Environment env) { 381 for (Selector i : rule.selectors) { 382 env.clearSelectorMatchingInformation(); 383 if (i.matches(env)) { 384 return i; 385 } 386 } 387 return null; 381 return rule.selectors.stream() 382 .filter(i -> i.matches(env.clearSelectorMatchingInformation())) 383 .findFirst() 384 .orElse(null); 388 385 } 389 386 … … 693 690 */ 694 691 private static void addIfNotSimilar(TestError toAdd, List<TestError> errors) { 695 boolean isDup = false; 696 if (toAdd.getPrimitives().size() >= 2) { 697 for (TestError e : errors) { 698 if (e.getCode() == toAdd.getCode() && e.getMessage().equals(toAdd.getMessage()) 692 final boolean isDup = toAdd.getPrimitives().size() >= 2 && errors.stream() 693 .anyMatch(e -> e.getCode() == toAdd.getCode() 694 && e.getMessage().equals(toAdd.getMessage()) 699 695 && e.getPrimitives().size() == toAdd.getPrimitives().size() 700 696 && e.getPrimitives().containsAll(toAdd.getPrimitives()) 701 && highlightedIsEqual(e.getHighlighted(), toAdd.getHighlighted())) { 702 isDup = true; 703 break; 704 } 705 } 706 } 697 && highlightedIsEqual(e.getHighlighted(), toAdd.getHighlighted())); 707 698 if (!isDup) 708 699 errors.add(toAdd); -
trunk/src/org/openstreetmap/josm/gui/mappaint/Environment.java
r15959 r15998 300 300 /** 301 301 * Clears all matching context information 302 */ 303 public void clearSelectorMatchingInformation() { 302 * @return this 303 */ 304 public Environment clearSelectorMatchingInformation() { 304 305 parent = null; 305 306 child = null; … … 309 310 intersections = null; 310 311 crossingWaysMap = null; 312 return this; 311 313 } 312 314
Note:
See TracChangeset
for help on using the changeset viewer.