Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-878

AbstractConsumer#parseDate() logs wrong locale in case of a ParseException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9.5
    • 1.10.0
    • maven-scm-api
    • None

    Description

      While testing SCM with JDK 10 the Jazz provider fails with:

      skip ParseException: Unparseable date: "Feb 25, 2012 10:13 PM" during parsing date Feb 25, 2012 10:13 PM with pattern MMM d, yyyy h:mm a with Locale en
      java.text.ParseException: Unparseable date: "Feb 25, 2012 10:13 PM"
              at java.base/java.text.DateFormat.parse(DateFormat.java:395)
              at org.apache.maven.scm.util.AbstractConsumer.parseDate(AbstractConsumer.java:112)
              at org.apache.maven.scm.util.AbstractConsumer.parseDate(AbstractConsumer.java:68)
              at org.apache.maven.scm.provider.jazz.command.changelog.JazzListChangesetConsumer.processModifiedLine(JazzListChangesetConsumer.java:341)
              at org.apache.maven.scm.provider.jazz.command.changelog.JazzListChangesetConsumer.consumeLine(JazzListChangesetConsumer.java:249)
              at org.apache.maven.scm.provider.jazz.command.changelog.JazzChangeLogCommandTest.testListChangesetConsumer(JazzChangeLogCommandTest.java:159)ListChangesetConsumer.java:341)

      Looking at the Jazz test code no locale is actually passed, so the default locale is used.

      The issue is rooted in the catch warn statement (in org.apache.maven.scm.util.AbstractConsumer.parseDate(String, String, String, Locale)) which assumes that a passed null locale defaults to Locale.ENGLISH. It shall display Locale.getDefault().

      Attachments

        Activity

          People

            michael-o Michael Osipov
            michael-o Michael Osipov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: