[ 
https://issues.apache.org/jira/browse/LANG-1520?focusedWorklogId=395642&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-395642
 ]

ASF GitHub Bot logged work on LANG-1520:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Mar/20 17:42
            Start Date: 01/Mar/20 17:42
    Worklog Time Spent: 10m 
      Work Description: coveralls commented on issue #498: LANG-1520 spring 
clean .gitignore
URL: https://github.com/apache/commons-lang/pull/498#issuecomment-593123744
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/29057827/badge)](https://coveralls.io/builds/29057827)
   
   Coverage remained the same at 95.101% when pulling 
**73cf2a5c5a36ce3d95c5eac0989b299815baa05b on nhojpatrick:LANG-1520** into 
**94b3784fdec5d0e9d63e4aec6772144b68283790 on apache:master**.
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 395642)
    Time Spent: 40m  (was: 0.5h)

> ObjectUtils.equals can use comparable if that's present.
> --------------------------------------------------------
>
>                 Key: LANG-1520
>                 URL: https://issues.apache.org/jira/browse/LANG-1520
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.9
>            Reporter: Sahil Soni
>            Priority: Minor
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> {{ObjectUtils.equals(Object, Object)}} is marked for deprecation in favour of 
> {{java.util.Objects.equals(Object, Object)}}
> We can improve {{ObjectUtils.equals}} to handle comparable objects,
>  For example, class A does not implement equals method, but does implements 
> Comparable interface. ObjectUtils.equals() will say its different, but 
> compareTo will say they are equal.
> To handle this, we can change the implementation to something like:
> {code:java}
> //instanceof checks for null, `null instanceof Comparable` is false, so this 
> condition is null safe
>         if (firstValue instanceof Comparable && secondValue instanceof 
> Comparable) {
>             return ((Comparable) firstValue).compareTo(secondValue) == 0;
>         }
>         return Objects.equals(firstValue, secondValue);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to