Modify

Opened 6 years ago

Closed 6 years ago

#10251 closed defect (fixed)

malformed validator rule may cause an exception

Reported by: mkoniecz Owned by: team
Priority: normal Milestone: 14.07
Component: Core validator Version:
Keywords: Cc:

Description (last modified by Don-vip)

Malformed custom validator rule

*[foot=yes][highway=footway][!access]{
  fixRemove: foot;
  throwWarning: tr("foot=yes redefines highway=footway that implies foot=designated [my rule]");
}

Note, it should be:

*[foot=yes][highway=footway][!access]{
  fixRemove: "foot";
  throwWarning: tr("foot=yes redefines highway=footway that implies foot=designated [my rule]");
}

with osm test case:

<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' upload='true' generator='JOSM'>
  <bounds minlat='50.0087871' minlon='19.9994516' maxlat='50.0090353' maxlon='19.9996233' origin='CGImap 0.3.3 (23659 thorn-02.openstreetmap.org)' />
  <bounds minlat='50.0087871' minlon='19.9994516' maxlat='50.0090353' maxlon='19.9996233' origin='OpenStreetMap server' />
  <bounds minlat='50.0087574' minlon='19.9994516' maxlat='50.0087871' maxlon='19.9996233' origin='CGImap 0.3.3 (23661 thorn-02.openstreetmap.org)' />
  <bounds minlat='50.0087574' minlon='19.9994516' maxlat='50.0087871' maxlon='19.9996233' origin='OpenStreetMap server' />
  <bounds minlat='50.0090353' minlon='19.9992177' maxlat='50.009065' maxlon='19.9998572' origin='CGImap 0.3.3 (23682 thorn-02.openstreetmap.org)' />
  <bounds minlat='50.0090353' minlon='19.9992177' maxlat='50.009065' maxlon='19.9998572' origin='OpenStreetMap server' />
  <bounds minlat='50.0087574' minlon='19.9992177' maxlat='50.0090353' maxlon='19.9994516' origin='CGImap 0.3.3 (31621 thorn-01.openstreetmap.org)' />
  <bounds minlat='50.0087574' minlon='19.9992177' maxlat='50.0090353' maxlon='19.9994516' origin='OpenStreetMap server' />
  <bounds minlat='50.0087574' minlon='19.9996233' maxlat='50.0090353' maxlon='19.9998572' origin='CGImap 0.3.3 (31427 thorn-01.openstreetmap.org)' />
  <bounds minlat='50.0087574' minlon='19.9996233' maxlat='50.0090353' maxlon='19.9998572' origin='OpenStreetMap server' />
  <node id='-4357' action='modify' visible='true' lat='50.00894925748' lon='19.99957671389' />
  <node id='-4356' action='modify' visible='true' lat='50.00895173948' lon='19.9994003482' />
  <way id='-4358' action='modify' visible='true'>
    <nd ref='-4356' />
    <nd ref='-4357' />
    <tag k='foot' v='yes' />
    <tag k='highway' v='footway' />
  </way>
</osm>

on running validation caused

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2014-07-09 01:37:29
Last Changed Author: bastiK
Revision: 7296
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2014-07-08 18:49:07 +0200 (Tue, 08 Jul 2014)
Last Changed Rev: 7296

Identification: JOSM/1.5 (7296 en) Windows 7 32-Bit
Memory Usage: 58 MB / 247 MB (9 MB allocated, but free)
Java version: 1.7.0_55, Oracle Corporation, Java HotSpot(TM) Client VM
Dataset consistency test: No problems found

Plugin: OpeningHoursEditor (30416)
Plugin: RoadSigns (30495)
Plugin: buildings_tools (30485)
Plugin: continuosDownload (28565)
Plugin: measurement (30416)
Plugin: notes (v0.9.2)
Plugin: turnrestrictions (30454)
Plugin: wikipedia (30449)

java.lang.NullPointerException
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$TagCheck.fixPrimitive(MapCSSTagChecker.java:378)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker$TagCheck.getErrorForPrimitive(MapCSSTagChecker.java:457)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.getErrorsForPrimitive(MapCSSTagChecker.java:516)
	at org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.check(MapCSSTagChecker.java:534)
	at org.openstreetmap.josm.data.validation.Test$TagTest.visit(Test.java:123)
	at org.openstreetmap.josm.data.osm.Way.accept(Way.java:214)
	at org.openstreetmap.josm.data.validation.Test.visit(Test.java:200)
	at org.openstreetmap.josm.actions.ValidateAction$ValidationTask.realRun(ValidateAction.java:169)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:82)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:150)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by Don-vip

Description: modified (diff)

comment:2 Changed 6 years ago by Don-vip

Milestone: 14.07

comment:3 Changed 6 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 7300/josm:

fix #10251 - NPE with malformed validator rule (invalid fixAdd/fixRemove)

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.