Modify

Opened 19 months ago

Last modified 19 months ago

#22466 new enhancement

Mapcss: allow [/REGEX/=string] selectors

Reported by: Famlam Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: template_report regex mapcss Cc:

Description

What steps will reproduce the problem?

  1. Add a rule way[/sidewalk:(left|right|both)/=yes] in mapcss validator rules
  2. Get the error below

What is the expected result?

Allow comparing regex keys with string values (i.e., support =, ^=, etc when they key is a regex)

What happens instead?

The error java.lang.IllegalArgumentException: Op must be REGEX or NREGEX

To work around it, you need a regex comparison like:
way[/^sidewalk:(left|right|both)$/=~/^yes$/]
(e.g. [/REGEX/=~/^string-as-regex$/] rather than [/REGEX/=string])

Please provide any additional information below. Attach a screenshot if possible.

Revision:18570
Build-Date:2022-10-07 11:33:30

Identification: JOSM/1.5 (18570 nl) Windows 10 64-Bit
OS Build number: Windows 10 Home 2009 (19044)
Memory Usage: 252 MB / 2012 MB (129 MB allocated, but free)
Java version: 17.0.4+8-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920×1080 (scaling 1.10×1.10)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1252
System property sun.jnu.encoding: Cp1252
Locale info: nl_NL
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=1.5.18570, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\JOSM.exe]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (35924)
+ SimplifyArea (35978)
+ imagery_offset_db (35978)
+ pbf (35978)
+ pt_assistant (1ff2e15)
+ reverter (36011)
+ tageditor (36011)
+ turnlanes-tagging (v0.0.5)
+ undelete (36011)
+ utilsplugin2 (36011)

Tagging presets:
+ http://mijndev.openstreetmap.nl/~allroads/JOSM/Presets/NL-Fiets.zip

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
+ %UserProfile%\Documents\tijdelijke bestanden\josm-eigen.mappaint.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&zip=1

Validator rules:
+ %UserProfile%\Documents\tijdelijke bestanden\josm-eigen.validator.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/SuspiciousSwimming_Pool&zip=1
+ https://raw.githubusercontent.com/Famlam/OsmMapcssValidationNL/main/netherlands.validator.mapcss
+ https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/TagFix_Destination.validator.mapcss
+ https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/Colour.validator.mapcss

Last errors/warnings:
- 00000.858 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00000.861 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00003.378 E: java.security.KeyStoreException: Windows-ROOT not found. Oorzaak: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available
- 00018.206 E: Lokaliseren van afbeelding 'bus.png' mislukt
- 00040.107 E: Handled by bug report queue: java.lang.IllegalArgumentException: Op must be REGEX or NREGEX



=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: File Watcher (28)
java.lang.IllegalArgumentException: Op must be REGEX or NREGEX
	at org.openstreetmap.josm.tools.CheckParameterUtil.ensureThat(CheckParameterUtil.java:49)
	at org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory$KeyValueRegexpCondition.<init>(ConditionFactory.java:378)
	at org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory$RegexpKeyValueRegexpCondition.<init>(ConditionFactory.java:413)
	at org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.createRegexpKeyRegexpValueCondition(ConditionFactory.java:94)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.simple_key_value_condition(MapCSSParser.java:1344)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.condition(MapCSSParser.java:1041)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.selector(MapCSSParser.java:961)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.child_selector(MapCSSParser.java:786)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.selectors(MapCSSParser.java:758)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.rule(MapCSSParser.java:743)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.sheet(MapCSSParser.java:727)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagCheckerRule.readMapCSS(MapCSSTagCheckerRule.java:194)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.addMapCSS(MapCSSTagChecker.java:290)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.addMapCSS(MapCSSTagChecker.java:267)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.reloadRule(MapCSSTagChecker.java:358)
	at org.openstreetmap.josm.io.FileWatcher.processEvents(FileWatcher.java:160)
	at java.base/java.lang.Thread.run(Unknown Source)

Attachments (0)

Change History (1)

comment:1 by skyper, 19 months ago

Component: Core validatorCore

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 Famlam.
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.