You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Christopher Schultz (Commented) (JIRA)" <de...@velocity.apache.org> on 2012/01/31 18:31:10 UTC

[jira] [Commented] (VELTOOLS-136) SortTool fails on null values

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

Christopher Schultz commented on VELTOOLS-136:
----------------------------------------------

Did you mean that SortTool doesn't accept null collections, or does not accept collections which contain null elements?

If the latter, where do you expect null elements to go? The end of the list? The beginning?
                
> SortTool fails on null values
> -----------------------------
>
>                 Key: VELTOOLS-136
>                 URL: https://issues.apache.org/jira/browse/VELTOOLS-136
>             Project: Velocity Tools
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Canny
>             Fix For: 2.0.x
>
>
> The sort tool uses "comparison = right.compareTo(null);" on line 276. That can fail in the case the right object compareTo() method can
> not handle null params. I.e. java.util.Date can not handle that, so the sort result is empty. The sort tool should support sorting of collections with
> null values.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org