Ticket #19053: 19053.5.patch

File 19053.5.patch, 3.0 KB (added by GerdP, 4 years ago)
  • src/org/openstreetmap/josm/data/validation/OsmValidator.java

     
    234234            } catch (SecurityException e) {
    235235                Logging.log(Logging.LEVEL_ERROR, "Unable to load ignored errors", e);
    236236            }
    237             // see #19053: remove invalid entry
    238             ignoredErrors.remove("3000");
     237            // see #19053:
     238            String legacyEntry = ignoredErrors.remove("3000");
     239            if (legacyEntry != null) {
     240                if (!legacyEntry.isEmpty()) {
     241                    addIgnoredError("3000_" + legacyEntry, legacyEntry);
     242                }
     243                saveIgnoredErrors();
     244            }
     245
    239246        }
    240247    }
    241248
  • src/org/openstreetmap/josm/data/validation/TestError.java

     
    338338     * @return The ignore sub group
    339339     */
    340340    public String getIgnoreSubGroup() {
     341        if (code == 3000) {
     342            // see #19053
     343            return "3000_" + (description == null ? descriptionEn : description);
     344        }
    341345        String ignorestring = getIgnoreGroup();
    342346        if (descriptionEn != null) {
    343347            ignorestring += '_' + descriptionEn;
     
    351355     * @see TestError#getIgnoreSubGroup()
    352356     */
    353357    public String getIgnoreGroup() {
     358        if (code == 3000) {
     359            // see #19053
     360            return "3000_" + getMessage();
     361        }
    354362        return Integer.toString(code);
    355363    }
    356364
     
    524532    public String toString() {
    525533        return "TestError [tester=" + tester + ", code=" + code + ", message=" + message + ']';
    526534    }
     535
    527536}
  • src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

     
    410410
    411411        lastSelectedNode = node;
    412412        if (node != null) {
    413             final Set<String> codes = new HashSet<>();
    414413            ValidatorTreePanel.visitTestErrors(node, error -> {
    415                 codes.add(error.getIgnoreSubGroup()); // see #19053
    416414                error.setSelected(true);
    417415
    418416                hasFixes.set(hasFixes.get() || error.isFixable());
     
    424422            });
    425423            selectAction.setEnabled(true);
    426424            if (ignoreAction != null) {
    427                 ignoreAction.setEnabled(!(node.getUserObject() instanceof Severity) && codes.size() <= 1);
     425                ignoreAction.setEnabled(!(node.getUserObject() instanceof Severity));
    428426            }
    429427        }
    430428