You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2018/07/09 15:32:00 UTC

[jira] [Commented] (LANG-1403) DateUtils.truncate(Object date, int field) breaks Java type safety.

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

Gary Gregory commented on LANG-1403:
------------------------------------

Note: Public methods can be removed in a major release.

> DateUtils.truncate(Object date, int field) breaks Java type safety.
> -------------------------------------------------------------------
>
>                 Key: LANG-1403
>                 URL: https://issues.apache.org/jira/browse/LANG-1403
>             Project: Commons Lang
>          Issue Type: Wish
>    Affects Versions: 3.7
>            Reporter: Christian
>            Priority: Minor
>
> The DateUtils.truncate have three types of possible date input. 
> Calendar, Date, and Object. 
> The method which accept object as input is not necessary and will break the type safety idea of java itself, so a wrong object will cause an runtime exception and can't be found at compile time. 
>  
> Solution:
> remove DateUtils.truncate(Object, int) method. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)