You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Uwe Barthel (JIRA)" <ji...@apache.org> on 2015/11/21 00:49:11 UTC
[jira] [Commented] (JXPATH-160) ValueUtils.getValue throws
exception with set and index above size
[ 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)