Changeset 18866 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2023-10-12T17:42:13+02:00 (9 months ago)
Author:
taylor.smock
Message:

Fix #23196: DataIntegrityProblemException: Primitive must be part of the dataset

It turns out that FilterModel doesn't care whether a primitive's referrers are
in the dataset or not.

This additionally adds a non-regression test and modifies WindowMocker to cover
some more headless exceptions. This additionally lets us stop mocking
ExtendedDialog#setupDialog.

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/FilterModel.java

    r18571 r18866  
    440440            }
    441441
    442             for (OsmPrimitive ref: p.getReferrers()) {
     442            for (OsmPrimitive ref: p.getReferrers(true)) {
    443443                stack.push(ref);
    444444            }
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r18607 r18866  
    8585 * read in all predefined presets, either shipped with JOSM or that are
    8686 * in the config directory.
    87  *
     87 * <p>
    8888 * It is also able to construct dialogs out of preset definitions.
    8989 * @since 294
     
    405405            /**
    406406             * This hack allows the items to have their own orientation.
    407              *
     407             * <p>
    408408             * The problem is that
    409409             * {@link org.openstreetmap.josm.gui.ExtendedDialog#showDialog ExtendedDialog} calls
    410410             * {@code applyComponentOrientation} very late in the dialog construction process thus
    411411             * overwriting the orientation the components have chosen for themselves.
    412              *
     412             * <p>
    413413             * This stops the propagation of {@code applyComponentOrientation}, thus all
    414414             * {@code TaggingPresetItem}s may (and have to) set their own orientation.
     
    446446
    447447        if (selected.size() == 1 && Boolean.TRUE.equals(USE_VALIDATOR.get())) {
    448             // Fail early -- validateAsync requires the primitive(s) to be part of a dataset. Failing later in validateAsync ''does not'' give us
    449             // a usable stack trace. See #21829 for details.
    450             selected.forEach(OsmPrimitive::checkDataset);
    451448            itemGuiSupport.addListener((source, key, newValue) ->
    452449                    TaggingPresetValidation.validateAsync(selected.iterator().next(), validationLabel, getChangedTags()));
Note: See TracChangeset for help on using the changeset viewer.