Changeset 17261 in josm for trunk/src/org
- Timestamp:
- 2020-10-24T11:54:52+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/TestError.java
r17252 r17261 11 11 import java.util.List; 12 12 import java.util.Locale; 13 import java.util.Set;14 13 import java.util.TreeSet; 15 14 import java.util.function.Supplier; … … 25 24 import org.openstreetmap.josm.data.osm.Way; 26 25 import org.openstreetmap.josm.data.osm.WaySegment; 27 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker;28 26 import org.openstreetmap.josm.data.validation.util.MultipleNameVisitor; 29 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;30 27 import org.openstreetmap.josm.tools.AlphanumComparator; 31 28 import org.openstreetmap.josm.tools.CheckParameterUtil; 32 29 import org.openstreetmap.josm.tools.I18n; 33 import org.openstreetmap.josm.tools.Logging;34 30 35 31 /** … … 549 545 } 550 546 551 /**552 * Test if the primitives still show the same error. Maybe data was already changed. See #19956553 * @return updated test or null if error cannot be reproduced.554 * @since 17252555 */556 public TestError doubleCheck() {557 // see #19956 check again558 if (getTester() instanceof MapCSSTagChecker)559 return this;560 Test tester2;561 try {562 tester2 = getTester().getClass().newInstance();563 Set<OsmPrimitive> toFix = primitives.stream()564 .filter(tester2::isPrimitiveUsable)565 .collect(Collectors.toSet());566 if (toFix.isEmpty())567 return null;568 569 tester2.startTest(NullProgressMonitor.INSTANCE);570 tester2.visit(toFix);571 tester2.endTest();572 for (TestError e : tester2.getErrors()) {573 if (e.getCode() == this.getCode()) {574 return e;575 }576 }577 } catch (InstantiationException | IllegalAccessException e1) {578 Logging.error(e1);579 }580 return null;581 582 }583 584 547 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r17252 r17261 628 628 if (error.isFixable()) { 629 629 if (error.getPrimitives().stream().noneMatch(p -> p.isDeleted() || p.getDataSet() == null)) { 630 TestError checked = error.doubleCheck(); 631 if (checked != null) { 632 final Command fixCommand = checked.getFix(); 633 if (fixCommand != null) { 634 SwingUtilities.invokeAndWait(fixCommand::executeCommand); 635 fixCommands.add(fixCommand); 636 } 630 final Command fixCommand = error.getFix(); 631 if (fixCommand != null) { 632 SwingUtilities.invokeAndWait(fixCommand::executeCommand); 633 fixCommands.add(fixCommand); 637 634 } 638 635 }
Note:
See TracChangeset
for help on using the changeset viewer.