abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amit Surana" <amitmsur...@gmail.com>
Subject org.apache.abdera.model.AtomDate - Needs Tweaking
Date Tue, 09 Sep 2008 07:30:23 GMT
Hi All,

I have just started looking into Abdera code and planning to contribute to
the Project (if i can).

In RFC4287: Date Consturcts
its mentioned that - A Date construct is an element whose content MUST
conform to the "date-time" production in [RFC3339].  In addition, an
uppercase **"T" character MUST** be used to separate date and time, and an
uppercase **"Z" character MUST** be present in the absence of a numeric time
zone offset.

But in the org.apache.abdera.model.AtomDate Implementation, When the Date is
passed as String, I saw that the PATTERN does not check if the Date Format
entered has T or Z.
I Tested the Pattern in a sample program.
I gave certain WRONG Inputs like -> "2008-09-08A20:00:00B+05:30"  or
"2008-09-08X23:30:00Y", etc
Instead of getting InvalidDateFormat Exception, I got the output as some
Irrelevant date.
I have tweaked the Date Regex Pattern and code which checks if the Input
contains T and Z also.
Please let me know, if I am wrong

PS: Attaching a sample Java Program which has the tweaked version of the
method required for parsing date when passed as String {method: parse(String

Amit M Surana

Blog: http://blog.suranaamit.com/
GMF Doc: http://gmfdoc.suranaamit.com/

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message