Modify ↓

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 skyper)

What steps will reproduce the problem?

  1. Have the preference validator.check_assert_local_rules set to true
  2. (Re-)Load a broken rule file containing backslashes '\' in the assertMatch values 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 skyper, 6 years ago

Oh. an odd number of " in the assertMatch triggers this, too.

comment:2 by skyper, 6 years ago

Keywords: mapcss added

comment:3 by skyper, 6 years ago

See #19685 for another exception raised by validating an incorrect rule.

Last edited 6 years ago by skyper (previous) (diff)

comment:4 by skyper, 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
Last edited 3 days ago by skyper (previous) (diff)

comment:5 by skyper, 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.

comment:6 by skyper, 3 days ago

Description: modified (diff)

add missing preference to description

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to skyper.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.