Opened 6 years ago
Last modified 5 years ago
#16767 new defect
fails to parse PH or when <time_selector> is not seperated by <space> after <weekday_selector> (only valid option) or when <rule_modifier> present, but accepts and saves some wrong values without warning
Reported by: | Owned by: | boman | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin openinghourseditor | Version: | |
Keywords: | template_report | Cc: |
Description
What steps will reproduce the problem?
- Try to edit valid opening_hours or save invalid ones
What is the expected result?
parse and display the correct ones and warn about the incorrect ones
(see title)
simple valid examples would be:
Mo12:00-13:00
and
12:00-13:00; PH,Sa 17:00-18:00
and
12:00-13:00, PH 17:00-18:00
and
10:00-19:00; 13:00-14:00 closed
invalid examples that are near enough it should probably understand it:
Mo 12:00-13:00 (parses, but this is not even valid because <weekday_selector> and <time_selector> are not separated by a space)
Sa,PH 17:00-18:00 (doesn't parse cause of PH, but this is not even valid because <holiday_sequence> must come before <weekday_sequence>)
It should probably also accept a space after the comma after a <holiday_sequence> and between <wday>s, as that is widely used, e.g.:
Sa, PH 17:00-18:00
reference: https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#selector:weekday
reference: https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#small_range_selectors
So it should understand the first four examples and warn about the last three that they are not according to the specification.
What happens instead?
doesn't parse correct one and doesn't warn about incorrect ones
Please provide any additional information below. Attach a screenshot if possible.
Revision:14268 Is-Local-Build:true Build-Date:2018-09-22 06:01:06 Identification: JOSM/1.5 (14268 SVN en) Linux Arch Linux Memory Usage: 1613 MB / 3974 MB (412 MB allocated, but free) Java version: 10.0.2+13, Oracle Corporation, OpenJDK 64-Bit Server VM Screen: :0.0 1920x1080 Maximum Screen Size: 1920x1080 VM arguments: [-Djosm.restart=true, -Djava.net.useSystemProxies=true] Dataset consistency test: No problems found Plugins: + AddrInterpolation (34506) + BuildingGeneralization (23) + CADTools (1007) + Create_grid_of_ways (34499) + CustomizePublicTransportStop (34501) + EasyPresets (1529414338) + ElevationProfile (34576) + FastDraw (34510) + FixAddresses (34511) + ImageWayPoint (34206) + ImproveOsm (143) + ImproveWay (24) + Mapillary (v1.5.16) + MicrosoftStreetside (34627) + OSMRecPlugin (34539) + OpenStreetCam (164) + OpeningHoursEditor (34535) + PicLayer (34544) + RoadSigns (34553) + ShapeTools (1240) + SimplifyArea (34586) + alignways (34489) + apache-commons (34506) + apache-http (34632) + areaselector (349) + austriaaddresshelper (57) + auto_tools (67) + buildings_tools (34572) + changeset-viewer (1537565805) + conflation (0.6.0) + continuosDownload (82) + editgpx (34506) + ejml (34389) + geochat (34512) + geotools (34513) + gpsblam (34515) + gpxfilter (34506) + graphview (34576) + gson (34389) + imagery_offset_db (34641) + jaxb (34506) + jna (34633) + jogl (1.2.2) + jts (34524) + livegps (34526) + log4j (34527) + mapathoner (v0.6.1) + mapdust (34528) + measurement (34529) + native_password_manager (34634) + o5m (34405) + openjfx (34625) + osmarender (34537) + pbf (34576) + pt_assistant (v2.1.5) + public_transport (34548) + public_transport_layer (34549) + reltoolbox (34614) + rex (49) + routes (34479) + routing (34554) + scoutsigns (128) + splinex (34557) + tag2link (34559) + tageditor (34560) + tagging-preset-tester (34561) + todo (30306) + turnlanes-tagging (272) + turnrestrictions (34643) + utilsplugin2 (34506) + wikipedia (v1.1.1) + wms-turbo-challenge2 (34570) Tagging presets: + https://raw.githubusercontent.com/yopaseopor/traffic_signs_preset_JOSM/master/DE.zip + https://josm.openstreetmap.de/josmfile?page=Presets/Surveillance&zip=1 + http://osmtools.de/josm/steps.xml + https://josm.openstreetmap.de/josmfile?page=Presets/Simple_Indoor_Tagging&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Telecom&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Towers&zip=1 + https://raw.githubusercontent.com/species/josm-preset-wheelchair/master/sidewalks_kerbs.xml + https://josm.openstreetmap.de/josmfile?page=Presets/Diving&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Quick-stops&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Quick-highways&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Tracks&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/PublicTransportOneClick&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Playground_Equipment&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/ParkingLanes&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/OSMRookie&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/OpenStationMap&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/OneClick&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/NewTags&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/NewParkingFeatures&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/MobilePhoneBaseStations&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Maxspeed-zones&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Manholes&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Light_sources&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Leaftype&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/LaneAttributes&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Industrial&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Historical_Objects&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Heritage&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Healthcare&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Drinks&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Crafts&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/contact(socialnetworks_IMs)&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Community_Centre&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Communication_Towers&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/CommonKeyboardShortcuts&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Camp_site_extends&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Bus_lanes&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/BuildingPreset&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Historic_Stone&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/BAR-damage-assessment&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Animal_facilities&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/Allergy&zip=1 + https://josm.openstreetmap.de/josmfile?page=Presets/AdvertisingPreset&zip=1 Map paint styles: + https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1 - https://www.dropbox.com/s/qo3ai47fpv241jf/Styles_Fixme_and_Notes.zip?raw=1 - https://raw.githubusercontent.com/yopaseopor/traffic_signs_style_JOSM/master/Styles_Traffic_signs_EUR.zip - https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Enhanced_Lane_and_Road_Attributes&zip=1 - https://github.com/osmlab/appledata/archive/josm_paint_inline_validation.zip - https://github.com/GlassOceanos/indoor-JOSM-style/archive/master.zip - https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_buildings&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/SlovakiaBicycleRoutes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/BesideTheRoad_Speed&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Bench&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/BAR-damage-assessment&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/AdvertisingStyle&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Suburb&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Postcode&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Kerbs&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Cycleways&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/DestinationSignRelation&zip=1 - https://raw.githubusercontent.com/species/josm-preset-traffic_sign_direction/master/direction.mapcss - https://github.com/hotosm/HDM-JOSM-style/archive/master.zip - https://josm.openstreetmap.de/josmfile?page=Styles/HiDPISupport&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Highway_Nodes&zip=1 + https://josm.openstreetmap.de/josmfile?page=Styles/Incline&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Landcover&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features_ryg&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/LessObtrusiveNodes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/light_source&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Lit&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/LitObjects&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1 - https://github.com/MissingMaps/josm_styles/archive/master.zip - https://pasharm.github.io/New_basic_style_for_JOSM/New_basic_style.mapcss + https://josm.openstreetmap.de/josmfile?page=Styles/NewHighwayColors&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/NewParkingFeatures&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/NoFeature&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/NumberedCycleNodeNetworks&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/NumberedWalkingNodeNetworks&zip=1 - https://raw.githubusercontent.com/OpenSidewalks/OpenSidewalks-Schema/master/open_sidewalks.mapcss - https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Potlach2_access&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/PriorityRoad&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/PTStops&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransportV2&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/RecyclingMaterials&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Schools&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/SimpleBuildingTags&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/SimpleRoofTags&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/MaxspeedIcons&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/RU-SubwayEntranceLabeling&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Noname&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Surface&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Surface-DataEntry&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/TreeCrownDiameter&zip=1 - https://raw.githubusercontent.com/species/josm-preset-wheelchair/master/sidewalks_kerbs.mapcss - http://kolesar.turistautak.hu/osm/opencellid/api/styles/cellid.mapcss - http://kolesar.turistautak.hu/osm/opencellid/api/styles/signal-size.mapcss - http://kolesar.turistautak.hu/osm/opencellid/api/styles/measurements.mapcss Validator rules: + https://josm.openstreetmap.de/josmfile?page=Rules/GermanySpecific&zip=1 + https://github.com/Jungle-Bus/transport_mapcss/raw/gh-pages/transport.validator.zip + https://raw.githubusercontent.com/stefan-a-bauer/josm-validators/master/mtb.validator.mapcss + https://www.openrailwaymap.org/validator/openrailwaymap.validator.mapcss + https://www.openrailwaymap.org/validator/de-openrailwaymap.validator.mapcss + https://josm.openstreetmap.de/josmfile?page=Rules/MissingWeekdays&zip=1 + https://raw.githubusercontent.com/OpenNauticalChart/josm/master/Seamark.validator.mapcss Last errors/warnings: - W: org.openstreetmap.josm.plugins.ohe.parser.TokenMgrError: Lexical error at line 1, column 20. Encountered: "P" (80), after : "" - W: Disable opening hours editor:: java.lang.Exception: Error in the TimeValue. Cause: org.openstreetmap.josm.plugins.ohe.parser.TokenMgrError: Lexical error at line 1, column 20. Encountered: "P" (80), after : "" - W: org.openstreetmap.josm.plugins.ohe.parser.TokenMgrError: Lexical error at line 1, column 20. Encountered: "P" (80), after : "" - W: Disable opening hours editor:: java.lang.Exception: Error in the TimeValue. Cause: org.openstreetmap.josm.plugins.ohe.parser.TokenMgrError: Lexical error at line 1, column 20. Encountered: "P" (80), after : "" - W: org.openstreetmap.josm.plugins.ohe.parser.TokenMgrError: Lexical error at line 1, column 20. Encountered: "P" (80), after : "" - W: Disable opening hours editor:: java.lang.Exception: Error in the TimeValue. Cause: org.openstreetmap.josm.plugins.ohe.parser.TokenMgrError: Lexical error at line 1, column 20. Encountered: "P" (80), after : "" - W: org.openstreetmap.josm.plugins.ohe.parser.ParseException: Encountered " " " " "" at line 1, column 13. - W: Disable opening hours editor:: java.lang.Exception: Error in the TimeValue. Cause: org.openstreetmap.josm.plugins.ohe.parser.ParseException: Encountered " " " " "" at line 1, column 13. - W: org.openstreetmap.josm.plugins.ohe.parser.ParseException: Encountered " " " " "" at line 1, column 12. - W: Disable opening hours editor:: java.lang.Exception: Error in the TimeValue. Cause: org.openstreetmap.josm.plugins.ohe.parser.ParseException: Encountered " " " " "" at line 1, column 12.
Attachments (0)
Change History (5)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Related with this, while trying to edit a place with Mo-Sa 07:30-22:00; Su,PH 08:00-13:00
(which is accepted by the opening_hours evaluation tool):
2018-11-16 03:17:26.260 ADVERTÊNCIA: org.openstreetmap.josm.plugins.ohe.parser.TokenMgrError: Lexical error at line 1, column 23. Encountered: "P" (80), after : "" org.openstreetmap.josm.plugins.ohe.parser.TokenMgrError: Lexical error at line 1, column 23. Encountered: "P" (80), after : "" at org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompilerTokenManager.getNextToken(OpeningTimeCompilerTokenManager.java:356) at org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler.jj_consume_token(OpeningTimeCompiler.java:328) at org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler.day(OpeningTimeCompiler.java:263) at org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler.dayspan(OpeningTimeCompiler.java:241) at org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler.dayspanlist(OpeningTimeCompiler.java:209) at org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler.dayspanlist(OpeningTimeCompiler.java:213) at org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler.timespan(OpeningTimeCompiler.java:85) at org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler.timespanlist(OpeningTimeCompiler.java:61) at org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler.timespanlist(OpeningTimeCompiler.java:65) at org.openstreetmap.josm.plugins.ohe.parser.OpeningTimeCompiler.startCompile(OpeningTimeCompiler.java:32) at org.openstreetmap.josm.plugins.ohe.gui.OheDialogPanel.getTime(OheDialogPanel.java:133) at org.openstreetmap.josm.plugins.ohe.gui.OheEditor.initTimeRects(OheEditor.java:187) at org.openstreetmap.josm.plugins.ohe.gui.OheEditor.<init>(OheEditor.java:96) at org.openstreetmap.josm.plugins.ohe.gui.OheDialogPanel.<init>(OheDialogPanel.java:103) at org.openstreetmap.josm.plugins.ohe.OhePlugin$OheMenuAction.actionPerformed(OhePlugin.java:302) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:369) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1020) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1064) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6632) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342) at java.desktop/java.awt.Component.processEvent(Component.java:6397) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) 2018-11-16 03:17:31.586 ADVERTÊNCIA: Disable opening hours editor:: java.lang.Exception: Error in the TimeValue. Causa: org.openstreetmap.josm.plugins.ohe.parser.TokenMgrError: Lexical error at line 1, column 23. Encountered: "P" (80), after : ""
comment:3 by , 6 years ago
@naoliv But strictly speaking Mo-Sa 07:30-22:00; Su,PH 08:00-13:00
is not valid because the PH must come before weekdays. The Editor shouldn't crash of course ;)
see also the examples put in:
openingh.openstreetmap.de/evaluation_tool/