You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Seifert (Jira)" <ji...@apache.org> on 2022/05/02 12:56:00 UTC
[jira] [Closed] (SLING-7931) SlingQuery - Last method doesn't work as expected
[ https://issues.apache.org/jira/browse/SLING-7931?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Seifert closed SLING-7931.
---------------------------------
> SlingQuery - Last method doesn't work as expected
> -------------------------------------------------
>
> Key: SLING-7931
> URL: https://issues.apache.org/jira/browse/SLING-7931
> Project: Sling
> Issue Type: Bug
> Components: Sling Query
> Affects Versions: Sling Query 4.0.2
> Environment: Java 8, AEM 6.4 SP1, Linux x64 Fedora
> Reporter: Michele Scala
> Assignee: Jason E Bailey
> Priority: Critical
> Labels: sling-query
> Fix For: Sling Query 4.0.4
>
> Attachments: sling-query-test-result.jpg, test-sling-query.groovy, test-sling-query.infinity.json
>
>
> Last() method of the Sling Query doesn't return the correct value in case you have filtered the resources before. I'll try to describe the problem with an example.
> *Expected*
> [ 1 , 2 , 3 , 4 ] –> FILTER ([n=1]) = [ 1 ] –> LAST = [ 1 ]
> *Current behavior*
> [ 1 , 2 , 3 , 4 ] –> FILTER ([n=1]) = [ 1 ] –> LAST = NULL
> I think the problem is related to last iterator that doesn't check if the next element is an empty option or a valid one.
> As attachment there is and an example that shows the bug.
>
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)