Blame command: Unparseable date when locale is not US
-----------------------------------------------------

                 Key: SCM-593
                 URL: http://jira.codehaus.org/browse/SCM-593
             Project: Maven SCM
          Issue Type: Bug
          Components: maven-scm-provider-mercurial (hg)
    Affects Versions: 1.4
         Environment: Windows
            Reporter: Lukasz Kozerski


Same problem as here: http://jira.codehaus.org/browse/SCM-551. Moreover 
exception message is not correct: org.apache.maven.scm.util.AbstractConsumer, 
line 120: 
bq. " with Locale " + ( locale == null ? Locale.ENGLISH : locale ) 
while we use 
bq. format = new SimpleDateFormat( defaultPattern );
with default locale.

Simple fix: on line 97, change 
bq. format = new SimpleDateFormat( defaultPattern );
to:
bq. format = new SimpleDateFormat( defaultPattern, Locale.US );

Stack trace:
{quote}
EXECUTING: cmd.exe /X /C "hg blame --user --date --number 
AbstractSiebelOperations.java"
[ERROR] skip ParseException: Unparseable date: "Thu Jul 08 11:42:09 2010 +0200" 
during parsing date Thu Jul 08 11:42:09
2010 +0200 with pattern EEE MMM dd HH:mm:ss yyyy Z with Locale en
java.text.ParseException: Unparseable date: "Thu Jul 08 11:42:09 2010 +0200"
        at java.text.DateFormat.parse(DateFormat.java:337)
        at 
org.apache.maven.scm.util.AbstractConsumer.parseDate(AbstractConsumer.java:112)
        at 
org.apache.maven.scm.util.AbstractConsumer.parseDate(AbstractConsumer.java:68)
{quote}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to