Opened 6 years ago
Last modified 3 days ago
#19503 new defect
Rules validation throws exception instead or warning
| Reported by: | skyper | Owned by: | team |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Core | Version: | |
| Keywords: | template_report rules validator mapcss | Cc: |
Description (last modified by )
What steps will reproduce the problem?
- Have the preference
validator.check_assert_local_rulesset totrue - (Re-)Load a broken rule file containing backslashes '\' in the
assertMatchvalues can cause this exception.
What is the expected result?
Message including the line and the position of the problem but no BugReportHandler
What happens instead?
BugReportHandler
Please provide any additional information below. Attach a screenshot if possible.
After that, JOSM stops to automatically reload the rule file.
Do not get the BugReportHandler all the time but the exception on the console.
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-07-06 23:02:10 +0200 (Mon, 06 Jul 2020)
Revision:16738
Build-Date:2020-07-07 01:30:48
URL:https://josm.openstreetmap.de/svn/trunk
Plugins:
+ tagging-preset-tester (35267)
Validator rules:
+ ${HOME}/JOSM/validator/GTFS_rules.mapcss
Last errors/warnings:
- E: Handled by bug report queue: java.lang.IllegalArgumentException: Expecting n/node/w/way/r/relation/area, but got '"node'
=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.
Warning issued by: BugReportExceptionHandler#handleException
=== STACK TRACE ===
Thread: File Watcher (23)
java.lang.IllegalArgumentException: Expecting n/node/w/way/r/relation/area, but got '"node'
at org.openstreetmap.josm.data.osm.OsmUtils.createPrimitive(OsmUtils.java:171)
at org.openstreetmap.josm.data.validation.tests.MapCSSTagCheckerAsserts.checkAsserts(MapCSSTagCheckerAsserts.java:60)
at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$TagCheck.ofMapCSSRule(MapCSSTagChecker.java:344)
at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$TagCheck.readMapCSS(MapCSSTagChecker.java:366)
at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.addMapCSS(MapCSSTagChecker.java:790)
at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.addMapCSS(MapCSSTagChecker.java:778)
at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.reloadRule(MapCSSTagChecker.java:858)
at org.openstreetmap.josm.io.FileWatcher.processEvents(FileWatcher.java:160)
at java.base/java.lang.Thread.run(Thread.java:834)
Attachments (0)
Change History (6)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
| Keywords: | mapcss added |
|---|
comment:4 by , 3 days ago
Well, I do not get an exception anymore and the broken file is (re)loaded but the assertMatch seem to be not evaluated at all. I would expect a warning at least on the console.
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2026-11-21 18:57:29 +0100 (Sat, 21 Nov 2026)
Revision:19700
Build-Date:2026-11-21 18:11:56
URL:https://josm.openstreetmap.de/svn/trunk
Identification: JOSM/1.5 (19700 en) Linux Debian GNU/Linux 13 (trixie)
Memory Usage: 408 MB / 3972 MB (259 MB allocated, but free)
Java version: 25.0.5.1+2-1-deb13u1-Debian, Debian, OpenJDK 64-Bit Server VM
Java package: openjdk-25-jre:amd64-25.0.5.1+2-1~deb13u1
Java ATK Wrapper package: libatk-wrapper-java:all-0.44.0-1~bpo13+1
fonts-noto: fonts-noto:all-20201225-2
VM arguments: [-Djosm.home=<josm.pref>]
Validator rules:
+ ${HOME}/Downloads/JOSM/buggy_rule.validator.mapcss
comment:5 by , 3 days ago
Stupid myself, you need to have the preference validator.check_assert_local_rules set to true to have the asserts to be evaluated and to trigger the exception.



Oh. an odd number of
"in theassertMatchtriggers this, too.