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

2018-07-11 Thread Sebb (JIRA)


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

Sebb commented on LANG-1403:


Are we sure that the Object method is not useful?

If we are, then I agree that deprecation would be a good first step, as at 
least there would be a warning at compile time.

Removal would require a change of package name and Maven coords as well as 
major version change.

> 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)


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

2018-07-11 Thread Christian Kleinewaechter (JIRA)


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

Christian Kleinewaechter commented on LANG-1403:


I agree that the overloaded methods with Object parameter provoke errors while 
giving very little value. Maybe deprecation could be an option?

> 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)


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

2018-07-10 Thread Christian (JIRA)


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

Christian commented on LANG-1403:
-

Additional methods which has the same behavior are:

ceiling, round and iterator 

> 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)


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

2018-07-09 Thread Gary Gregory (JIRA)


[ 
https://issues.apache.org/jira/browse/LANG-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)