Changeset 18607 in josm for trunk


Ignore:
Timestamp:
2022-12-05T14:37:26+01:00 (23 months ago)
Author:
taylor.smock
Message:

See #21829: DataIntegrityProblemException: Primitive must be part of the dataset

This ensures we fail earlier -- validateAsync is called later from the EDT,
which means we cannot figure out where the data came from.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r18574 r18607  
    445445        }
    446446
    447         if (selected.size() == 1 && USE_VALIDATOR.get()) {
     447        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);
    448451            itemGuiSupport.addListener((source, key, newValue) ->
    449452                    TaggingPresetValidation.validateAsync(selected.iterator().next(), validationLabel, getChangedTags()));
Note: See TracChangeset for help on using the changeset viewer.