[
https://issues.apache.org/jira/browse/LANG-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory resolved LANG-1465.
-----------------------------------
Resolution: Resolved
Resolving: See commit
[f713b4fc1a681db2ee368847ae826c638691ba86|https://github.com/apache/commons-lang/commit/f713b4fc1a681db2ee368847ae826c638691ba86]
The reported compatibility break between 3.4 and 3.5 is reproducible, but
current ZZ parsing matches its documented contract: accept Z or a
colon-separated offset such as -05:00, and reject -0500.
Restoring the older behavior would introduce another compatibility change.
Applications may rely on rejection, and accepting additional inputs can change
which pattern DateUtils selects and therefore the returned date. The proposed
shared-strategy change also unintentionally relaxes XXX parsing.
Clarify the DateUtils Javadoc instead. Link to FastDateParser, explain the
timezone differences from SimpleDateFormat, and identify Z or XX as
alternatives for offsets without colons. Apply this clarification to all
parsing overloads and record it in changes.xml.
> DateUtils.parseDate backward Incompatibility bug
> ------------------------------------------------
>
> Key: LANG-1465
> URL: https://issues.apache.org/jira/browse/LANG-1465
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.time.*
> Affects Versions: 3.5, 3.6, 3.7, 3.8, 3.9, 3.8.1
> Environment: System: Linux testinglab 4.4.0-131-generic
> #157~14.04.1-Ubuntu
> Java version "1.8.0_191"
> Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
>
>
> Reporter: xia0c
> Priority: Minor
> Labels: performance
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Hi,
> The following code snippets throw a ParseException when trying to parse the
> time. It works well before commons-lang 3.4. When I update commons-lang to
> 3.5 or newer versions, it failed.
> {code:java}
> @Test
> public void Demo() throws ParseException {
> assertEquals("Tue Jun 11 15:06:11 CDT 2019",
> DateUtils.parseDate("2019-06-11T15:06:11.716-0500",
> "yyyy-MM-dd'T'HH:mm:ss.SSSZZ"));
>
> }
> {code}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)