Modify ↓
Opened 4 years ago
Closed 4 years ago
#19343 closed enhancement (fixed)
Report commands involving way/node when reporting DataIntegrityProblemException: Deleted node referenced
Reported by: | simon04 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 20.06 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description (last modified by )
-
src/org/openstreetmap/josm/data/osm/Way.java
diff --git a/src/org/openstreetmap/josm/data/osm/Way.java b/src/org/openstreetmap/josm/data/osm/Way.java index df2ee3cbc..37122d6f1 100644
a b 12 12 import java.util.stream.Collectors; 13 13 import java.util.stream.IntStream; 14 14 15 import org.openstreetmap.josm.command.PseudoCommand; 16 import org.openstreetmap.josm.data.UndoRedoHandler; 15 17 import org.openstreetmap.josm.data.coor.LatLon; 16 18 import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor; 17 19 import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor; … … private void checkNodes() { 532 534 if (n.getDataSet() != dataSet) 533 535 throw new DataIntegrityProblemException("Nodes in way must be in the same dataset", 534 536 tr("Nodes in way must be in the same dataset")); 535 if (n.isDeleted()) 536 throw new DataIntegrityProblemException("Deleted node referenced: " + toString(), 537 if (n.isDeleted()) { 538 String commands = UndoRedoHandler.getInstance().getUndoCommands().stream() 539 .filter(c -> c.getParticipatingPrimitives().contains(n) || c.getParticipatingPrimitives().contains(this)) 540 .map(PseudoCommand::getDescriptionText) 541 .collect(Collectors.joining(", ")); 542 throw new DataIntegrityProblemException(String.format( 543 "Deleted node referenced: %s (changed by the following commands: %s)", toString(), commands), 537 544 "<html>" + tr("Deleted node referenced by {0}", 538 545 DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(this)) + "</html>"); 546 } 539 547 } 540 548 if (Config.getPref().getBoolean("debug.checkNullCoor", true)) { 541 549 for (Node n: nodes) {
What do you think? This might be helpful for debugging the many issues (query).
Attachments (0)
Change History (4)
comment:1 by , 4 years ago
Description: | modified (diff) |
---|
comment:2 by , 4 years ago
Note:
See TracTickets
for help on using tickets.
I would definitely appreciate it for my debugging purposes. When I first started working on the MapWithAI plugin, I ran into that issue a lot.