commons-issues mailing list archives

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

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

Niall Pemberton commented on LANG-667:
--------------------------------------

@Julien - thanks for the suggestion, I'll look at this when I get home

@Paul - Lang is all about adding useful utilities that Java itself doesn't have and theres
alot of *prior art* here of null-safe utilities. Julien's example is a great demonstration
of how this function can be used to simplify code. This feature is not a Comparable implementation
and so breaks no contract. I really don't understand your objection and IMO its a very weak
argument to object on the basis of Comparable's JavaDoc. How would you handle implementing
a compareTo() method where the properties being compared may be null - surely you're not arguing
that Julien's example should fail and throw a NullPointerException if one of the properties
is null?

> 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