maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Osipov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SCM-878) AbstractConsumer#parseDate() logs wrong locale in case of a ParseException
Date Sun, 01 Apr 2018 22:58:00 GMT

    [ https://issues.apache.org/jira/browse/SCM-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16421839#comment-16421839
] 

Michael Osipov commented on SCM-878:
------------------------------------

Branch pushed, verified to work on:
{noformat}
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"{noformat}
and
{noformat}
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
Maven home: /opt/apache-maven-3.5.3
Java version: 10, vendor: Azul Systems, Inc.
Java home: /usr/lib/jvm/zulu-10
Default locale: de_DE, platform encoding: UTF-8
OS name: "linux", version: "4.11.12-200.fc25.x86_64", arch: "amd64", family: "unix"{noformat}
tried with {{de_DE}} and {{en_AU}} which has a period after short month name in Java 10 (not
Java 8).

> AbstractConsumer#parseDate() logs wrong locale in case of a ParseException
> --------------------------------------------------------------------------
>
>                 Key: SCM-878
>                 URL: https://issues.apache.org/jira/browse/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
>            Priority: Major
>             Fix For: 1.9.6
>
>
> While testing SCM with JDK 10 the Jazz provider fails with:
> {noformat}
> 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){noformat}
> 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()}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message