Modify

Opened 13 months ago

Closed 2 months ago

#13920 closed defect (fixed)

IllegalArgumentException: does not contain '='

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

Description

Using an incomplete (and thus wrong) validation rule:

*["addr:postcode" =~ /^[0-9]{8}$/] {
        throwWarning: tr("CEP pode ser melhorado");
        fixAdd: concat(substring(tag("addr:postcode"), 0, 4), "-", substring(tag("addr:postcode"), 5, 7));
}

I got this:

Build-Date:2016-11-05 17:22:19
Revision:11221
Is-Local-Build:true

Identification: JOSM/1.5 (11221 SVN pt_BR) Linux Debian GNU/Linux unstable (sid)
Memory Usage: 450 MB / 4029 MB (102 MB allocated, but free)
Java version: 1.8.0_111-8u111-b14-3-b14, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 1920x1080
Maximum Screen Size: 1920x1080
Java package: openjdk-8-jre:amd64-8u111-b14-3
Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-9
VM arguments: [-Dawt.useSystemAAFontSettings=on]
Dataset consistency test: No problems found

Plugins:
+ AddrInterpolation (32699)
+ Create_grid_of_ways (32699)
+ FastDraw (32938)
+ FixAddresses (32796)
+ ImportImagePlugin (32699)
+ OpeningHoursEditor (32699)
+ PicLayer (32796)
+ SimplifyArea (32796)
+ apache-commons (32699)
+ buildings_tools (32944)
+ download_along (32946)
+ editgpx (32699)
+ ejml (32680)
+ geojson (43)
+ geotools (33042)
+ graphview (32796)
+ jogl (1.0.46)
+ jts (32699)
+ kendzi3d (1.0.191)
+ kendzi3d-resources (0.0.1)
+ log4j (32699)
+ measurement (32936)
+ merge-overlap (32699)
+ opendata (33049)
+ pdfimport (32796)
+ photo_geotagging (32699)
+ poly (32699)
+ reverter (32796)
+ tageditor (33021)
+ tagging-preset-tester (32869)
+ todo (30000)
+ turnlanes-tagging (252)
+ turnrestrictions (32796)
+ undelete (32699)
+ utilsplugin2 (32815)

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

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- 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/Lane_features_ryg&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Highway_Nodes&zip=1
- /tmp/bla.mapcss
- https://github.com/OSMBrasil/mapnik-brasil/archive/master.zip 

Validator rules:
+ ${HOME}/git/validador-josm/Rules_Brazilian-Specific.validator.mapcss
+ ${HOME}/git/validador-josm/staging.validator.mapcss
- /tmp/caray.validator.mapcss

Last errors/warnings:
- W: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "<EOF>" at line 68, column 2.
- W: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "<EOF>" at line 68, column 2.
- W: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "<EOF>" at line 68, column 2.
- W: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "<EOF>" at line 67, column 2.
- W: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "<EOF>" at line 67, column 2.
- W: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "<EOF>" at line 67, column 2.
- W: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "<EOF>" at line 67, column 2.
- W: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "<EOF>" at line 67, column 2.
- W: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "<EOF>" at line 67, column 2.
- E: Handled by bug report queue: java.lang.IllegalArgumentException: '1480-02' does not contain '='


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

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (20) of main
java.lang.IllegalArgumentException: '1480-02' does not contain '='
	at org.openstreetmap.josm.data.osm.Tag.ofString(Tag.java:133)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$FixCommand$1.createCommand(MapCSSTagChecker.java:176)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$TagCheck.fixPrimitive(MapCSSTagChecker.java:495)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$TagCheck.getErrorForPrimitive(MapCSSTagChecker.java:573)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.getErrorsForPrimitive(MapCSSTagChecker.java:688)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.getErrorsForPrimitive(MapCSSTagChecker.java:673)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.check(MapCSSTagChecker.java:705)
	at org.openstreetmap.josm.data.validation.Test$TagTest.visit(Test.java:123)
	at org.openstreetmap.josm.data.osm.Node.accept(Node.java:230)
	at org.openstreetmap.josm.data.validation.Test.visit(Test.java:211)
	at org.openstreetmap.josm.actions.ValidateAction$ValidationTask.realRun(ValidateAction.java:166)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:141)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

It's the same problem from #13630

Attachments (0)

Change History (2)

comment:1 Changed 2 months ago by Don-vip

Milestone: 17.10

comment:2 Changed 2 months ago by Don-vip

Resolution: fixed
Status: newclosed

In 12975/josm:

fix #13920 - robustness against invalid mapcss code - catch error and log it (fix command is optional)

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.