Ticket #22074: 22074.patch
| File 22074.patch, 1.8 KB (added by , 4 years ago) |
|---|
-
src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
42 42 private static final Collection<String> KEYS_TO_CHECK = Arrays.asList("opening_hours", "collection_times", "service_times"); 43 43 private static final BooleanProperty PREF_STRICT_MODE = 44 44 new BooleanProperty(ValidatorPrefHelper.PREFIX + "." + OpeningHourTest.class.getSimpleName() + "." + "strict", false); 45 private static final BooleanProperty PREF_STRICT_TIME_MODE = 46 new BooleanProperty(ValidatorPrefHelper.PREFIX + "." + OpeningHourTest.class.getSimpleName() + "." + "strict_time", false); 45 47 private final JCheckBox checkboxStrictMode = new JCheckBox(tr("Enable strict mode.")); 46 48 47 49 /** … … 102 104 String prettifiedValue = null; 103 105 try { 104 106 final boolean strict = PREF_STRICT_MODE.get(); 105 final List<Rule> rules = new OpeningHoursParser(new StringReader(value)).rules(strict); 107 final boolean strictTime = PREF_STRICT_TIME_MODE.get(); 108 final List<Rule> rules = new OpeningHoursParser(new StringReader(value)).rules(strict, strictTime); 106 109 prettifiedValue = Util.rulesToOpeningHoursString(rules); 107 110 if (!Objects.equals(value, prettifiedValue) && !strict) { 108 111 // parse again in strict mode for detailed message 109 new OpeningHoursParser(new StringReader(value)).rules(true );112 new OpeningHoursParser(new StringReader(value)).rules(true, strictTime); 110 113 } 111 114 } catch (OpeningHoursParseException e) { 112 115 String message = e.getExceptions().stream()
