commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Kang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LANG-1121) FastDateFormat.parse() does not handle wrong length string
Date Wed, 29 Apr 2015 04:59:05 GMT

     [ https://issues.apache.org/jira/browse/LANG-1121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Henry Kang updated LANG-1121:
-----------------------------
    Description: 
FDFP does not handled wrong length string.

for example,
{code}
// Wed Apr 29 00:00:00 KST 2015
FastDateFormat.getInstance("yyyyMMdd").parse("20150429");
// throws ParseException
FastDateFormat.getInstance("yyyyMMdd").parse("2015");
// Thu Mar 16 00:00:00 KST 81724
FastDateFormat.getInstance("yyyyMMdd").parse("20150429113100");
{code}
I think result of third throws ParseException,
but FastDateFormat.parse() returns wrong year, ex, 81724 instead of 2015.

As I tested,
regex.matcher.group => (2015)(04)(29113100) => setCalendar => March 16, 81724



  was:
FDFP does not handled wrong length string.

for example,

// Wed Apr 29 00:00:00 KST 2015
FastDateFormat.getInstance("yyyyMMdd").parse("20150429");
// throws ParseException
FastDateFormat.getInstance("yyyyMMdd").parse("2015");
// Thu Mar 16 00:00:00 KST 81724
FastDateFormat.getInstance("yyyyMMdd").parse("20150429113100");

I think result of third throws ParseException,
but FastDateFormat.parse() returns wrong year, ex, 81724 instead of 2015.

As I tested,
regex.matcher.group => (2015)(04)(29113100) => setCalendar => March 16, 81724




> FastDateFormat.parse() does not handle wrong length string
> ----------------------------------------------------------
>
>                 Key: LANG-1121
>                 URL: https://issues.apache.org/jira/browse/LANG-1121
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>    Affects Versions: 3.3.2
>            Reporter: Henry Kang
>            Priority: Minor
>
> FDFP does not handled wrong length string.
> for example,
> {code}
> // Wed Apr 29 00:00:00 KST 2015
> FastDateFormat.getInstance("yyyyMMdd").parse("20150429");
> // throws ParseException
> FastDateFormat.getInstance("yyyyMMdd").parse("2015");
> // Thu Mar 16 00:00:00 KST 81724
> FastDateFormat.getInstance("yyyyMMdd").parse("20150429113100");
> {code}
> I think result of third throws ParseException,
> but FastDateFormat.parse() returns wrong year, ex, 81724 instead of 2015.
> As I tested,
> regex.matcher.group => (2015)(04)(29113100) => setCalendar => March 16, 81724



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message