commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Barthel (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JXPATH-160) ValueUtils.getValue throws exception with set and index above size
Date Fri, 20 Nov 2015 23:49:11 GMT

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

Uwe Barthel commented on JXPATH-160:
------------------------------------

Open pull request: [JXPATH-160: Patch and test attached on JIRA item applied.|https://github.com/apache/commons-jxpath/pull/6]

The test passed on current trunk.

Thanks to [~stalbrecht] for providing the original patch and test sources and to [~vivodamichele@hotmail.com]
for extending the test.

> 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 was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message