Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 95608180B9 for ; Mon, 18 Jan 2016 16:49:40 +0000 (UTC) Received: (qmail 69586 invoked by uid 500); 18 Jan 2016 16:49:40 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 69167 invoked by uid 500); 18 Jan 2016 16:49:40 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 69145 invoked by uid 99); 18 Jan 2016 16:49:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jan 2016 16:49:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C60672C1F55 for ; Mon, 18 Jan 2016 16:49:39 +0000 (UTC) Date: Mon, 18 Jan 2016 16:49:39 +0000 (UTC) From: "Markus Jelsma (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LANG-1202) parseDateStrictly does't pass specified locale MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-1202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15105510#comment-15105510 ] Markus Jelsma commented on LANG-1202: ------------------------------------- Anyway, these are the changes due to lack of producing a normal patch file {code} @Test public void testLANG799whichDidNotWork() throws ParseException { DateUtils.parseDateStrictly("09 abril 2008 23:55:38 GMT", new Locale("es"), new String[]{"dd MMM yyyy HH:mm:ss zzz"}); } {code} {code} /** *

Parses a string representing a date by trying a variety of different parsers, * using the default date format symbols for the given locale..

* *

The parse will try each parse pattern in turn. * A parse is only deemed successful if it parses the whole of the input string. * If no parse patterns match, a ParseException is thrown.

* The parser parses strictly - it does not allow for dates such as "February 942, 1996". * * @param str the date to parse, not null * @param locale the locale whose date format symbols should be used. If null, * the system locale is used (as per {@link #parseDateStrictly(String, String...)}). * @param parsePatterns the date format patterns to use, see SimpleDateFormat, not null * @return the parsed date * @throws IllegalArgumentException if the date string or pattern array is null * @throws ParseException if none of the date patterns were suitable * @since 3.2 */ public static Date parseDateStrictly(final String str, final Locale locale, final String... parsePatterns) throws ParseException { return parseDateWithLeniency(str, locale, parsePatterns, false); } {code} > parseDateStrictly does't pass specified locale > ---------------------------------------------- > > Key: LANG-1202 > URL: https://issues.apache.org/jira/browse/LANG-1202 > Project: Commons Lang > Issue Type: Bug > Components: lang.time.* > Affects Versions: 3.4 > Reporter: Markus Jelsma > Fix For: 3.5 > > Attachments: LANG-1202.patch > > > LANG-799 added support for specifying a locale, but parseDateStrictly() doesn't pass it to the final parseDateWithLeniency() method. -- This message was sent by Atlassian JIRA (v6.3.4#6332)