[jira] Created: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
[PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
------------------------------------------------------------------------------------

                 Key: LANG-383
                 URL: https://issues.apache.org/jira/browse/LANG-383
             Project: Commons Lang
          Issue Type: Improvement
    Affects Versions: 2.3
         Environment: Apple OSX 10.4.11 java 1.5.0_07
            Reporter: Travis Meisenheimer
            Priority: Minor
             Fix For: 2.4


I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  

The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)

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

Travis Meisenheimer updated LANG-383:
-------------------------------------

    Attachment: DateUtils.java.patch

DateUtils patch.

> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: DateUtils.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
In reply to this post by Dmitri Blinov (Jira)

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

Travis Meisenheimer updated LANG-383:
-------------------------------------

    Attachment: DateUtilsTest.java.patch

Patch for test case.

> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: DateUtils.java.patch, DateUtilsTest.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
In reply to this post by Dmitri Blinov (Jira)

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

Travis Meisenheimer updated LANG-383:
-------------------------------------

    Attachment:     (was: DateUtils.java.patch)

> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: DateUtilsTest.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
In reply to this post by Dmitri Blinov (Jira)

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

Travis Meisenheimer updated LANG-383:
-------------------------------------

    Attachment: DateUtils.java.patch

Patch for DateUtils

> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: DateUtils.java.patch, DateUtilsTest.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
In reply to this post by Dmitri Blinov (Jira)

    [ https://issues.apache.org/jira/browse/LANG-383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554226 ]

Henri Yandell commented on LANG-383:
------------------------------------

Any thoughts? I'm ambivalent.

> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: DateUtils.java.patch, DateUtilsTest.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
In reply to this post by Dmitri Blinov (Jira)

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

Henri Yandell updated LANG-383:
-------------------------------

    Fix Version/s:     (was: 2.4)

> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>         Attachments: DateUtils.java.patch, DateUtilsTest.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
In reply to this post by Dmitri Blinov (Jira)

    [ https://issues.apache.org/jira/browse/LANG-383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554270 ]

Gary Gregory commented on LANG-383:
-----------------------------------

This kind of code seems useful from a high level, kind of like a macro but the impl of the low-level method makes me think about multi-threaded issues because of the misnamed, IMO, "Calendar.getInstance()" method. I would at least add in an in-line comment that states that Calendar c = Calendar.getInstance(); returns a new object, and therefore the method is thread safe.


> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>         Attachments: DateUtils.java.patch, DateUtilsTest.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
In reply to this post by Dmitri Blinov (Jira)

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

Travis Meisenheimer updated LANG-383:
-------------------------------------

    Attachment: DateUtils.java.patch

Thanks Henri and Greg for the comments.  I've cleaned up the javadocs and added the inline comment mentioned to help clear things up a tad.

> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>         Attachments: DateUtils.java.patch, DateUtils.java.patch, DateUtilsTest.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
In reply to this post by Dmitri Blinov (Jira)

    [ https://issues.apache.org/jira/browse/LANG-383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554308 ]

tmeisenh edited comment on LANG-383 at 12/24/07 2:05 PM:
--------------------------------------------------------------------

Thanks Henri and Gary for the comments.  I've cleaned up the javadocs and added the inline comment mentioned to help clear things up a tad.

      was (Author: tmeisenh):
    Thanks Henri and Greg for the comments.  I've cleaned up the javadocs and added the inline comment mentioned to help clear things up a tad.
 

> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>         Attachments: DateUtils.java.patch, DateUtils.java.patch, DateUtilsTest.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
In reply to this post by Dmitri Blinov (Jira)

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

Henri Yandell updated LANG-383:
-------------------------------

    Fix Version/s: 2.4

Consider for 2.4, and either include or close wontfix.

> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: DateUtils.java.patch, DateUtils.java.patch, DateUtilsTest.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
In reply to this post by Dmitri Blinov (Jira)

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

Henri Yandell closed LANG-383.
------------------------------

    Resolution: Fixed

Patch applied - with the one change in which I made the generic set(...) method private (and therefore deleted its test). Will create an issue suggesting we make the add(...) generic method private in 3.0.

Thanks Travis.

svn ci -m "Applying the Date.setXxx replacement methods that use Calendar as supplied by Travis Meisenheimer in LANG-383" src
Sending        src/java/org/apache/commons/lang/time/DateUtils.java
Sending        src/test/org/apache/commons/lang/time/DateUtilsTest.java
Transmitting file data ..
Committed revision 610668.

> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: DateUtils.java.patch, DateUtils.java.patch, DateUtilsTest.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (LANG-383) [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.

Dmitri Blinov (Jira)
In reply to this post by Dmitri Blinov (Jira)

    [ https://issues.apache.org/jira/browse/LANG-383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557542#action_12557542 ]

bayard edited comment on LANG-383 at 1/9/08 8:45 PM:
------------------------------------------------------------

Patch applied - with the one change in which I made the generic set(...) method private (and therefore deleted its test). I've deprecated the already existing public add(...) generic method.

Thanks Travis.

svn ci -m "Applying the Date.setXxx replacement methods that use Calendar as supplied by Travis Meisenheimer in LANG-383" src
Sending        src/java/org/apache/commons/lang/time/DateUtils.java
Sending        src/test/org/apache/commons/lang/time/DateUtilsTest.java
Transmitting file data ..
Committed revision 610668.

      was (Author: bayard):
    Patch applied - with the one change in which I made the generic set(...) method private (and therefore deleted its test). Will create an issue suggesting we make the add(...) generic method private in 3.0.

Thanks Travis.

svn ci -m "Applying the Date.setXxx replacement methods that use Calendar as supplied by Travis Meisenheimer in LANG-383" src
Sending        src/java/org/apache/commons/lang/time/DateUtils.java
Sending        src/test/org/apache/commons/lang/time/DateUtilsTest.java
Transmitting file data ..
Committed revision 610668.
 

> [PATCH] Adding functionality to DateUtils to allow direct setting of various fields.
> ------------------------------------------------------------------------------------
>
>                 Key: LANG-383
>                 URL: https://issues.apache.org/jira/browse/LANG-383
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 2.3
>         Environment: Apple OSX 10.4.11 java 1.5.0_07
>            Reporter: Travis Meisenheimer
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: DateUtils.java.patch, DateUtils.java.patch, DateUtilsTest.java.patch
>
>
> I'm submitting a patch for commons-lang's DateUtils to add a few methods that make setting various fields in a Date object a bit cleaner than "normal ways" I've seen it done.  The methods behave exactly like the add* methods do, except the calendar that is used is set to non-lenient.  
> The patch doesn't contain much, just a few trivial methods I always carried around as an enhancement to commons-lang's DateUtils.  Perhaps someone else will find these useful, or not.  A patch to the DateUtilsTest is included as well along with output from running the test and the corresponding test suite.

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