You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by "Amit Surana (JIRA)" <ji...@apache.org> on 2008/09/09 13:55:44 UTC

[jira] Created: (ABDERA-199) [core] AtomDate does not check for Date Constructs having T & Z separations between Date and Time

[core] AtomDate does not check for Date Constructs having T & Z  separations between Date and Time 
---------------------------------------------------------------------------------------------------

                 Key: ABDERA-199
                 URL: https://issues.apache.org/jira/browse/ABDERA-199
             Project: Abdera
          Issue Type: Bug
    Affects Versions: 0.4.0
            Reporter: Amit Surana
            Priority: Minor


In RFC4287: Date Consturcts Section, 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.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ABDERA-199) [core] AtomDate does not check for Date Constructs having T & Z separations between Date and Time

Posted by "Amit Surana (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ABDERA-199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amit Surana updated ABDERA-199:
-------------------------------

    Attachment: patch.txt

I have tweaked the Date Regex Pattern and code which checks if the Input contains T and Z also. 
I am attaching a patch for the issue. 

Sample Examples from Old Code: 
Test1: 
Input: AtomDate.parse("2008-09-08A20:00:00Z+05:30")
Output: Mon Sep 08 05:30:00 IST 2008 

Test2: 
Input: AtomDate.parse("2008-09-08T20:00:00X+05:30")
Output: Tue Sep 09 01:30:00 IST 2008

Test3: 
Input: AtomDate.parse("2008-09-08T20:00:00Z+05:30")
Output: Mon Sep 08 20:00:00 IST 2008 //EXPECTED OUTCOME


Sample Examples AFTER Fixing the Code and Date Regex

Test1: 
Input: AtomDate.parse("2008-09-08A20:00:00Z+05:30")
Output: Exception

Test2: 
Input: AtomDate.parse("2008-09-08T20:00:00X+05:30")
Output: Exception

Test3: 
Input: AtomDate.parse("2008-09-08T20:00:00Z+05:30")
Output: Mon Sep 08 20:00:00 IST 2008 //EXPECTED OUTCOME


> [core] AtomDate does not check for Date Constructs having T & Z  separations between Date and Time 
> ---------------------------------------------------------------------------------------------------
>
>                 Key: ABDERA-199
>                 URL: https://issues.apache.org/jira/browse/ABDERA-199
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.4.0
>            Reporter: Amit Surana
>            Priority: Minor
>         Attachments: patch.txt
>
>
> In RFC4287: Date Consturcts Section, 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (ABDERA-199) [core] AtomDate does not check for Date Constructs having T & Z separations between Date and Time

Posted by "David Calavera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ABDERA-199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Calavera closed ABDERA-199.
---------------------------------

    Resolution: Fixed
      Assignee: David Calavera

> [core] AtomDate does not check for Date Constructs having T & Z  separations between Date and Time 
> ---------------------------------------------------------------------------------------------------
>
>                 Key: ABDERA-199
>                 URL: https://issues.apache.org/jira/browse/ABDERA-199
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.4.0
>            Reporter: Amit Surana
>            Assignee: David Calavera
>            Priority: Minor
>         Attachments: patch.txt, patch.txt
>
>
> In RFC4287: Date Consturcts Section, 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ABDERA-199) [core] AtomDate does not check for Date Constructs having T & Z separations between Date and Time

Posted by "Amit Surana (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ABDERA-199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amit Surana updated ABDERA-199:
-------------------------------

    Attachment: patch.txt

David, 
Please find an updated patch. Let me know if any more test cases break. I checked with all possible examples even with invalid date. So if I had missed out any case do let me know. 

cheers, 
/Amit

> [core] AtomDate does not check for Date Constructs having T & Z  separations between Date and Time 
> ---------------------------------------------------------------------------------------------------
>
>                 Key: ABDERA-199
>                 URL: https://issues.apache.org/jira/browse/ABDERA-199
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.4.0
>            Reporter: Amit Surana
>            Priority: Minor
>         Attachments: patch.txt, patch.txt
>
>
> In RFC4287: Date Consturcts Section, 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ABDERA-199) [core] AtomDate does not check for Date Constructs having T & Z separations between Date and Time

Posted by "David Calavera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ABDERA-199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632231#action_12632231 ] 

David Calavera commented on ABDERA-199:
---------------------------------------

This patch breaks several tests. Can you fix these tests and submit the patch again?

Thank you.

> [core] AtomDate does not check for Date Constructs having T & Z  separations between Date and Time 
> ---------------------------------------------------------------------------------------------------
>
>                 Key: ABDERA-199
>                 URL: https://issues.apache.org/jira/browse/ABDERA-199
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.4.0
>            Reporter: Amit Surana
>            Priority: Minor
>         Attachments: patch.txt
>
>
> In RFC4287: Date Consturcts Section, 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.