abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Calavera" <david.calav...@gmail.com>
Subject Re: org.apache.abdera.model.AtomDate - Needs Tweaking
Date Tue, 09 Sep 2008 10:06:41 GMT
Hi Amit,

could you open a ticket in jira and provide a patch with any test cases?

thank you

On Tue, Sep 9, 2008 at 9:30 AM, Amit Surana <amitmsurana@gmail.com> wrote:

>
> Hi All,
>
> I have just started looking into Abdera code and planning to contribute to
> the Project (if i can).
>
> In RFC4287: Date Consturcts Section<http://tools.ietf.org/html/rfc4287#section-3.3>,
> 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
> Date)}
>
>
> --
> Regards,
> Amit M Surana
>
> Blog: http://blog.suranaamit.com/
> GMF Doc: http://gmfdoc.suranaamit.com/
>



-- 
David Calavera
http://www.thinkincode.net

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