Michele Scala created SLING-7931:
------------------------------------

             Summary: 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
         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
(v7.6.3#76005)

Reply via email to