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

Adrian Crum commented on OFBIZ-4545:
------------------------------------

The method:

public static String formatDate(Date date, DateFormat dateFormatter)

is not needed. If you already have both objects, then you can format the date 
with them.

Do not test for null arguments and return an empty String - that is a bad 
design pattern that makes development and debugging difficult. If client code 
passes a null argument to the method, then the method should throw a NPE - that 
is how you let the client code know that it is doing something wrong. See the 
current version of UtilDateTime.java, line 760 and below for the correct way to 
implement date/time methods.

                
> DateFormat API extension
> ------------------------
>
>                 Key: OFBIZ-4545
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4545
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Dimitri Unruh
>            Priority: Minor
>         Attachments: OFBIZ-4545.patch, OFBIZ-4545.patch
>
>
> Some API extensions for Dateformating

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to