[jira] Created: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)
Mark UtilDateTime.java deprecated methods as deprecated
-------------------------------------------------------

                 Key: OFBIZ-1361
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
             Project: OFBiz
          Issue Type: Improvement
          Components: framework
            Reporter: Adrian Crum
            Priority: Minor


Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

--
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: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)

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

Adrian Crum updated OFBIZ-1361:
-------------------------------

    Attachment: UtilDateTime.patch

Attached patch deprecates the UtilDateTime.java methods that shouldn't be used.


> Mark UtilDateTime.java deprecated methods as deprecated
> -------------------------------------------------------
>
>                 Key: OFBIZ-1361
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

--
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: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536541 ]

David E. Jones commented on OFBIZ-1361:
---------------------------------------

While I agree that this should be the best practice, there is a big difference in the framework between what we "allow" and what we "recommend".

There is lots of stuff you _can_ do with the framework that is really not a good idea, thought some might disagree. Things that we recommend should be documented in the Best Practices Guide. Other things we don't want to make more difficult, IMO, that this is important because of the comment about disagreement above. There are pretty much always good reasons why we do things the way we recommend in the framework, but those recommendations have evolved over time and will continue to evolve as well, and not allowing things we don't recommend stifles this and limits opportunity to progress and improve.

That is of course a generality, and there is a clear best practice here that should be documented and it probably won't ever change, but I'm still against forcing on a matter of principle.


> Mark UtilDateTime.java deprecated methods as deprecated
> -------------------------------------------------------
>
>                 Key: OFBIZ-1361
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

--
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: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536553 ]

Adrian Crum commented on OFBIZ-1361:
------------------------------------

David,

Thanks for your input. I don't understand what you're saying though.

If those methods aren't deprecated, then developers will continue to use them. This will lead to problems down the road with inconsistent data - users are going to encounter two different results for the same date/time criteria. Are you saying inconsistent data is something we should allow?


> Mark UtilDateTime.java deprecated methods as deprecated
> -------------------------------------------------------
>
>                 Key: OFBIZ-1361
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

--
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: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536561 ]

Wickersheimer Jeremy commented on OFBIZ-1361:
---------------------------------------------

David, i understand your point but marking the methods deprecated doesn't remove them, so they can still be used.
However they should not be used, as Adrian points out they do not use the correct locale so there output will be inconsistent. Marking the deprecated is a good way to say that the code using them should be migrated at, and it would also make the compiler throw out useful warnings.

> Mark UtilDateTime.java deprecated methods as deprecated
> -------------------------------------------------------
>
>                 Key: OFBIZ-1361
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

--
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: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536574 ]

Jacques Le Roux commented on OFBIZ-1361:
----------------------------------------

David,

I agree with David and Jeremy. Deprecating ans documenting it in code seems a good idea in this case. There are better chances to be read than in the Best practices Guides (pragmatic POV) which does not mean that this should not be documented at this higher level too. Is there something else we are missing ?

> Mark UtilDateTime.java deprecated methods as deprecated
> -------------------------------------------------------
>
>                 Key: OFBIZ-1361
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

--
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: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Adrian Crum closed OFBIZ-1361.
------------------------------

    Resolution: Later

Due to differences in opinion and no clear consensus, I'm closing this. We can look at it again later.

> Mark UtilDateTime.java deprecated methods as deprecated
> -------------------------------------------------------
>
>                 Key: OFBIZ-1361
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

--
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] Reopened: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Jacques Le Roux reopened OFBIZ-1361:
------------------------------------

      Assignee: Adrian Crum

From discussion in https://issues.apache.org/jira/browse/OFBIZ-2177 I think it's time to reopen this issue

> Mark UtilDateTime.java deprecated methods as deprecated
> -------------------------------------------------------
>
>                 Key: OFBIZ-1361
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Assignee: Adrian Crum
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

--
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: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672437#action_12672437 ]

Jacques Le Roux commented on OFBIZ-1361:
----------------------------------------

To be clear, I second Adrian's proposition to deprecate these methods and I will do soon if nobody stops me.

> Mark UtilDateTime.java deprecated methods as deprecated
> -------------------------------------------------------
>
>                 Key: OFBIZ-1361
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Assignee: Adrian Crum
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

--
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: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672442#action_12672442 ]

Adrian Crum commented on OFBIZ-1361:
------------------------------------

Jacques,

Since you assigned it to me, I assumed I would be working on it. ;-)

Hold off on any commits, I'm updating UtilDateTime to provide easy-to-use alternatives to the planned deprecated methods.


> Mark UtilDateTime.java deprecated methods as deprecated
> -------------------------------------------------------
>
>                 Key: OFBIZ-1361
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Assignee: Adrian Crum
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

--
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: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12672444#action_12672444 ]

Jacques Le Roux commented on OFBIZ-1361:
----------------------------------------

Hi Adrian,

Cool, please feel free and *thanks* :)

> Mark UtilDateTime.java deprecated methods as deprecated
> -------------------------------------------------------
>
>                 Key: OFBIZ-1361
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Assignee: Adrian Crum
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

--
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] Assigned: (OFBIZ-1361) Mark UtilDateTime.java deprecated methods as deprecated

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Adrian Crum reassigned OFBIZ-1361:
----------------------------------

    Assignee:     (was: Adrian Crum)

I'm removing myself from this issue because it is too controversial. If someone else wants to work on it they are welcome to do so.


> Mark UtilDateTime.java deprecated methods as deprecated
> -------------------------------------------------------
>
>                 Key: OFBIZ-1361
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1361
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Priority: Minor
>         Attachments: UtilDateTime.patch
>
>
> Now that user-selected locale and time support has been added to the framework, it's time to start weeding out date/time code that doesn't use the Locale and TimeZone objects.

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