From e5e9dba8e45606b45a5cbbdba6c5210dc5edd666 Mon Sep 17 00:00:00 2001
From: simonpoole <simon@poole.ch>
Date: Tue, 17 May 2022 10:14:39 +0200
Subject: [PATCH 1/2] Disable time strict mode
This change makes parsing in strict mode slightly more lenient with
respect to time ranges that extend over midnight, with other words this
will no longer complain if non-conflicting long time ranges are used
instead of using the extended time syntax.
Parsing in non-strict mode remains unchanged.
---
.../josm/data/validation/tests/OpeningHourTest.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java b/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
index a396c3eb9..d81aff4bf 100644
|
a
|
b
|
public class OpeningHourTest extends TagTest {
|
| 102 | 102 | String prettifiedValue = null; |
| 103 | 103 | try { |
| 104 | 104 | final boolean strict = PREF_STRICT_MODE.get(); |
| 105 | | final List<Rule> rules = new OpeningHoursParser(new StringReader(value)).rules(strict); |
| | 105 | final List<Rule> rules = new OpeningHoursParser(new StringReader(value)).rules(strict, false); |
| 106 | 106 | prettifiedValue = Util.rulesToOpeningHoursString(rules); |
| 107 | 107 | if (!Objects.equals(value, prettifiedValue) && !strict) { |
| 108 | 108 | // parse again in strict mode for detailed message |
| 109 | | new OpeningHoursParser(new StringReader(value)).rules(true); |
| | 109 | new OpeningHoursParser(new StringReader(value)).rules(true, false); |
| 110 | 110 | } |
| 111 | 111 | } catch (OpeningHoursParseException e) { |
| 112 | 112 | String message = e.getExceptions().stream() |