commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-667) Add a Null-safe compare() method to ObjectUtils
Date Fri, 07 Jan 2011 07:25:45 GMT

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

Paul Benedict commented on LANG-667:
------------------------------------

This feature sounds like a bad idea because it goes against the contract of Comparable. From
the javadocs:
"e.compareTo(null) should throw a NullPointerException even though e.equals(null) returns
false."

There is explicitly no such thing as a null-safe compare() in Java.

> Add a Null-safe compare() method to ObjectUtils
> -----------------------------------------------
>
>                 Key: LANG-667
>                 URL: https://issues.apache.org/jira/browse/LANG-667
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*
>    Affects Versions: 2.5
>            Reporter: Niall Pemberton
>            Assignee: Niall Pemberton
>            Priority: Minor
>             Fix For: 3.0
>
>
> Add a Null-safe compare() method to ObjectUtils

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


Mime
View raw message