You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benedikt Ritter (JIRA)" <ji...@apache.org> on 2015/11/24 17:24:11 UTC

[jira] [Resolved] (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:all-tabpanel ]

Benedikt Ritter resolved JXPATH-160.
------------------------------------
    Resolution: Fixed
      Assignee: Benedikt Ritter

{code}
$ svn ci -m "JXPATH-160: ValueUtils.getValue throws exception with set and index above size. Thanks to Stefan Albrecht, Michele Vivoda and Uwe Barthel. This also fixes #6 from github."
Sending        src/changes/changes.xml
Sending        src/main/java/org/apache/commons/jxpath/util/ValueUtils.java
Adding         src/test/java/org/apache/commons/jxpath/util/ValueUtilsTest.java
Transmitting file data ...
Committed revision 1716195.
{code}

Thank you all for contributing!

> 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
>            Assignee: Benedikt Ritter
>             Fix For: 1.4
>
>         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)