commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michele Vivoda (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JXPATH-160) ValueUtils.getValue throws exception with set and index above size
Date Mon, 19 Aug 2013 16:57:48 GMT

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

Michele Vivoda commented on JXPATH-160:
---------------------------------------

I think the observations and the patch of Stefan are correct: behavior changes depending on
implementation of the collection.


                
> ValueUtils.getValue throws exception with set and index above size
> ------------------------------------------------------------------
>
>                 Key: JXPATH-160
>                 URL: https://issues.apache.org/jira/browse/JXPATH-160
>             Project: Commons JXPath
>          Issue Type: Bug
>    Affects Versions: 1.3, 1.4
>            Reporter: Stefan Albrecht
>         Attachments: NullValueFromSet.patch, ValueUtilsTest.java, ValueUtilsTest.java
>
>
> ValueUtils offers a utility method to retrieve an indexed value from a collection. In
case this collection is an array or a List, the method returns null if the index is above
the size. If the supplied collection is a Set instead, then a NoSuchElementException is thrown
if index is above size.
> The desired behavior is that the result is the same for all kinds of collections and
that even in the case of a Set null is returned if the index value is too large.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message