Ignore:
Timestamp:
2021-03-19T19:52:15+01:00 (5 years ago)
Author:
simon04
Message:

see #20626 - OpeningHoursParser: report multiple parse exceptions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java

    r16832 r17591  
    1111import java.util.Locale;
    1212import java.util.Objects;
     13import java.util.stream.Collectors;
    1314
    1415import javax.swing.JCheckBox;
    1516import javax.swing.JPanel;
    1617
     18import ch.poole.openinghoursparser.OpeningHoursParseException;
    1719import ch.poole.openinghoursparser.OpeningHoursParser;
    18 import ch.poole.openinghoursparser.ParseException;
    1920import ch.poole.openinghoursparser.Rule;
    2021import ch.poole.openinghoursparser.Util;
     
    106107                new OpeningHoursParser(new StringReader(value)).rules(true);
    107108            }
    108         } catch (ParseException e) {
    109             return Collections.singletonList(createTestError(Severity.WARNING, e.getMessage(), key, value, prettifiedValue, p));
     109        } catch (OpeningHoursParseException e) {
     110            String message = e.getExceptions().stream()
     111                    .map(OpeningHoursParseException::getMessage)
     112                    .distinct()
     113                    .collect(Collectors.joining("; "));
     114            return Collections.singletonList(createTestError(Severity.WARNING, message, key, value, prettifiedValue, p));
    110115        }
    111116
Note: See TracChangeset for help on using the changeset viewer.