Modify

Opened 2 years ago

Closed 2 years ago

Last modified 13 months ago

#14368 closed defect (fixed)

java.util.regex.PatternSyntaxException: Unclosed group

Reported by: naoliv Owned by: team
Priority: normal Milestone: 17.02
Component: Core mappaint Version:
Keywords: template_report mapcss Cc:

Description

I was playing with some (wrong) rules and got:

2017-02-14 11:43:45.208 GRAVE: Handled by bug report queue: java.util.regex.PatternSyntaxException: Unclosed group near index 30
Rodovia ([A-Z]{2,3}-[0-9]{2,4}
                              ^
java.util.regex.PatternSyntaxException: Unclosed group near index 30
Rodovia ([A-Z]{2,3}-[0-9]{2,4}
                              ^
	at java.util.regex.Pattern.error(Pattern.java:1955)
	at java.util.regex.Pattern.accept(Pattern.java:1813)
	at java.util.regex.Pattern.group0(Pattern.java:2908)
	at java.util.regex.Pattern.sequence(Pattern.java:2051)
	at java.util.regex.Pattern.expr(Pattern.java:1996)
	at java.util.regex.Pattern.compile(Pattern.java:1696)
	at java.util.regex.Pattern.<init>(Pattern.java:1351)
	at java.util.regex.Pattern.compile(Pattern.java:1028)
	at org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory$KeyValueRegexpCondition.<init>(ConditionFactory.java:346)
	at org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.createKeyValueCondition(ConditionFactory.java:58)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.simple_key_value_condition(MapCSSParser.java:1477)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.condition(MapCSSParser.java:1173)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.selector(MapCSSParser.java:1093)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.child_selector(MapCSSParser.java:939)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.selectors(MapCSSParser.java:911)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.rule(MapCSSParser.java:902)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.sheet(MapCSSParser.java:886)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$TagCheck.readMapCSS(MapCSSTagChecker.java:362)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.addMapCSS(MapCSSTagChecker.java:723)
	at org.openstreetmap.josm.io.FileWatcher.processEvents(FileWatcher.java:149)
	at java.lang.Thread.run(Thread.java:745)

The bad rule is:

way[highway][name =~ /Rodovia ([A-Z]{2,3}-[0-9]{2,4}/] {
        throwWarning: tr("teste");
}
URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2017-02-14 00:32:15 +0100 (Tue, 14 Feb 2017)
Build-Date:2017-02-13 23:35:58
Revision:11560
Relative:URL: ^/trunk

Identification: JOSM/1.5 (11560 pt_BR) Linux Debian GNU/Linux 9.0 (stretch)
Memory Usage: 839 MB / 10206 MB (337 MB allocated, but free)
Java version: 1.8.0_121-8u121-b13-3-b13, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 1600x900, :0.1 1280x1024
Maximum Screen Size: 1600x1024
Java package: openjdk-8-jre:amd64-8u121-b13-3
Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-13
VM arguments: [-Dawt.useSystemAAFontSettings=on]
Dataset consistency test: No problems found

Plugins:
+ Create_grid_of_ways (32699)
+ FastDraw (33004)
+ ImportImagePlugin (33028)
+ OpeningHoursEditor (33004)
+ PicLayer (33088)
+ RoadSigns (33088)
+ SimplifyArea (33004)
+ apache-commons (32994)
+ buildings_tools (33004)
+ conflation (0.3.0)
+ contourmerge (1030)
+ download_along (32946)
+ editgpx (33004)
+ ejml (32680)
+ geojson (52)
+ geotools (33042)
+ importvec (33088)
+ indoorhelper (33088)
+ jts (32699)
+ log4j (32699)
+ measurement (33088)
+ merge-overlap (33004)
+ opendata (33088)
+ pbf (33004)
+ pdfimport (33004)
+ poly (33004)
+ reverter (33088)
+ scripting (30764)
+ tageditor (33021)
+ todo (30000)
+ turnlanes (33088)
+ turnlanes-tagging (254)
+ turnrestrictions (33088)
+ undelete (32699)
+ utilsplugin2 (33124)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/NewTags&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Surface-DataEntry&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Noname&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Highway_Nodes&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- <josm.pref>/styles/indoor.mapcss
- https://dl.dropbox.com/u/8010189/Forum%20attachments/Hide_nodes.mapcss

Validator rules:
+ /arquivos/git/validador-josm/Rules_Brazilian-Specific.validator.mapcss
+ /arquivos/git/validador-josm/staging.validator.mapcss
- <josm.pref>/validator/indoorhelper.validator.mapcss

Last errors/warnings:
- E: A comunicação com o servidor OSM falhou - <html>O tempo de comunicação com o servidor OSM 'api.openstreetmap.org' esgotou. Por favor tente de novo.</html>
- E: org.openstreetmap.josm.io.OsmApiException: ResponseCode=503, Error Body=<<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
- E: A comunicação com o servidor OSM falhou - <html>O tempo de comunicação com o servidor OSM 'api.openstreetmap.org' esgotou. Por favor tente de novo.</html>
- E: Skipping to the next rule, because of an error:
- E: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered " "~" "~ "" at line 233, column 15.
- E: Skipping to the next rule, because of an error:
- E: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered " "~" "~ "" at line 233, column 15.
- E: Skipping to the next rule, because of an error:
- E: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered " "~" "~ "" at line 233, column 15.
- E: Handled by bug report queue: java.util.regex.PatternSyntaxException: Unclosed group near index 30


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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: File Watcher (12)
java.util.regex.PatternSyntaxException: Unclosed group near index 30
Rodovia ([A-Z]{2,3}-[0-9]{2,4}
                              ^
	at java.util.regex.Pattern.error(Pattern.java:1955)
	at java.util.regex.Pattern.accept(Pattern.java:1813)
	at java.util.regex.Pattern.group0(Pattern.java:2908)
	at java.util.regex.Pattern.sequence(Pattern.java:2051)
	at java.util.regex.Pattern.expr(Pattern.java:1996)
	at java.util.regex.Pattern.compile(Pattern.java:1696)
	at java.util.regex.Pattern.<init>(Pattern.java:1351)
	at java.util.regex.Pattern.compile(Pattern.java:1028)
	at org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory$KeyValueRegexpCondition.<init>(ConditionFactory.java:346)
	at org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.createKeyValueCondition(ConditionFactory.java:58)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.simple_key_value_condition(MapCSSParser.java:1477)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.condition(MapCSSParser.java:1173)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.selector(MapCSSParser.java:1093)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.child_selector(MapCSSParser.java:939)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.selectors(MapCSSParser.java:911)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.rule(MapCSSParser.java:902)
	at org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser.sheet(MapCSSParser.java:886)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$TagCheck.readMapCSS(MapCSSTagChecker.java:362)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.addMapCSS(MapCSSTagChecker.java:723)
	at org.openstreetmap.josm.io.FileWatcher.processEvents(FileWatcher.java:149)
	at java.lang.Thread.run(Thread.java:745)

Attachments (0)

Change History (3)

comment:1 Changed 2 years ago by Don-vip

Component: Core validatorCore mappaint
Keywords: mapcss added
Milestone: 17.02

comment:2 Changed 2 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 11562/josm:

fix #14368 - java.util.regex.PatternSyntaxException: Unclosed group

comment:3 Changed 13 months ago by Don-vip

Ticket #12105 has been marked as a duplicate of this ticket.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.