maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Osipov (JIRA)" <>
Subject [jira] [Created] (SCM-878) .AbstractConsumer#parseDate() logs wrong locale in case of ParseException
Date Sun, 01 Apr 2018 21:32:00 GMT
Michael Osipov created SCM-878:

             Summary: .AbstractConsumer#parseDate() logs wrong locale in case of ParseException
                 Key: SCM-878
             Project: Maven SCM
          Issue Type: Bug
          Components: maven-scm-api
    Affects Versions: 1.9.5
         Environment: Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
Maven home: D:\Entwicklung\Programme\apache-maven-3.5.3\bin\..
Java version: 10, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk-10
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
            Reporter: Michael Osipov
            Assignee: Michael Osipov
             Fix For: 1.9.6

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(
        at org.apache.maven.scm.util.AbstractConsumer.parseDate(
        at org.apache.maven.scm.util.AbstractConsumer.parseDate(
        at org.apache.maven.scm.provider.jazz.command.changelog.JazzListChangesetConsumer.processModifiedLine(
        at org.apache.maven.scm.provider.jazz.command.changelog.JazzListChangesetConsumer.consumeLine(
        at org.apache.maven.scm.provider.jazz.command.changelog.JazzChangeLogCommandTest.testListChangesetConsumer({noformat}
Looking th 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()}}.

This message was sent by Atlassian JIRA

View raw message