commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LANG-1090) FastDateParser does not set error indication in ParsePosition
Date Mon, 02 Mar 2015 21:41:05 GMT

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

Sebb resolved LANG-1090.
------------------------
       Resolution: Fixed
    Fix Version/s: 3.4

URL: http://svn.apache.org/r1663438
Log:
LANG-1090 FastDateParser does not set error indication in ParsePosition

Modified:
    commons/proper/lang/trunk/src/changes/changes.xml
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/time/FastDateParserSDFTest.java


> FastDateParser does not set error indication in ParsePosition
> -------------------------------------------------------------
>
>                 Key: LANG-1090
>                 URL: https://issues.apache.org/jira/browse/LANG-1090
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>            Priority: Minor
>             Fix For: 3.4
>
>
> FastDateParser#parse(String,ParsePosition) does not throw ParseException if the input
cannot be matched.
> If the parse succeeds, the ParsePosition is updated to the index of the next character
after the last one used, and the error index is left as -1.
> If the parse fails, at present the ParsePosition is not updated at all, unlike SimpleDateFormat
which is able to set the error Index to the location where the error occurr.
> It does not appear to be possible to determine the error location because the matching
against the format string is all or nothing.
> This means that a successful parse can only be detected by checking whether the ParsePosition
has been updated.
> This needs to be documented, and some unit tests added.



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

Mime
View raw message