#10913 closed defect (fixed)
Sequential execution of fix* commands in validator rules
Reported by: | mkoniecz | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 15.04 |
Component: | Core validator | Version: | |
Keywords: | template_report | Cc: | Klumbumbus |
Description
What steps will reproduce the problem?
- Make validator rule with multiple fix* commands
For example:
fixChangeKey: "highway => construction"; fixAdd: "highway=construction";
executed on
highway=tertiary, construction=yes
What is the expected result?
fix* commands operate on state modified by previous fix* operations:
1. highway=tertiary; construction=yes <before> 2. construction=tertiary <after fixChangeKey: "highway => construction";> 3. highway=construction; construction=tertiary <after fixAdd: "highway => construction";>
What happens instead?
Output is
construction=construction
It is equivalent of executing fixAdd before fixChangeKey. Order of fix* commands is ignored (it is neither going first to last nor from last to first). Adding fixRemove "construction"; failed to improve situation (I hoped that fixChangeKey refuses to overwrite existing key).
Please provide any additional information below. Attach a screenshot if possible.
Repository Root: http://josm.openstreetmap.de/svn Build-Date: 2015-01-01 02:35:00 Last Changed Author: Don-vip Revision: 7919 Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Relative URL: ^/trunk URL: http://josm.openstreetmap.de/svn/trunk Last Changed Date: 2015-01-01 02:55:34 +0100 (Thu, 01 Jan 2015) Last Changed Rev: 7919 Identification: JOSM/1.5 (7919 en) Linux Ubuntu 14.04.1 LTS Memory Usage: 326 MB / 889 MB (164 MB allocated, but free) Java version: 1.7.0_72, Oracle Corporation, Java HotSpot(TM) Server VM Dataset consistency test: No problems found Plugins: - OpeningHoursEditor (30892) - buildings_tools (30892) - continuosDownload (1413902943) - ext_tools (30892) - measurement (30892)
I was attempting to run custom validation rule
*[construction=yes][highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service|living_street|pedestrian|cycleway|footway|steps|path|bridleway|track|bus_guideway|raceway|road|/][highway!=construction] { throwWarning: tr("{0} with {1}=* (highway=construction, construction=* is a superior tagging scheme)", "{0.tag}", "{1.key}", "{1.value}"); fixRemove: "construction"; fixChangeKey: "highway => construction"; fixAdd: "highway=construction"; }
on http://www.openstreetmap.org/way/185001688
Making separate rule for every highway value would be feasible but awful hack.
Attachments (0)
Change History (9)
comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 10 years ago
Component: | Core → Core validator |
---|---|
Milestone: | → 15.01 |
comment:3 by , 10 years ago
Milestone: | 15.01 → 15.02 |
---|
comment:4 by , 10 years ago
Milestone: | 15.02 |
---|
comment:5 by , 10 years ago
comment:6 by , 10 years ago
I plan to fix it but I have no time right now and I can't promise any date. It won't be for this release at least.
comment:8 by , 10 years ago
Milestone: | → 15.04 |
---|
So I should rather use workaround rather than waiting for fix?