Skip to main content

[el-spec commits] [el-spec~source-code:175] Fix skip issue.

  • From: kchung@...
  • To: commits@...
  • Subject: [el-spec commits] [el-spec~source-code:175] Fix skip issue.
  • Date: Thu, 19 Jul 2012 18:55:00 +0000

Project:    el-spec
Repository: source-code
Revision:   175
Author:     kchung
Date:       2012-07-19 18:54:56 UTC
Link:       

Log Message:
------------
Fix skip issue.



Revisions:
----------
175


Modified Paths:
---------------
trunk/impl/src/main/java/com/sun/el/query/Skip.java
trunk/src/test/java/org/glassfish/el/test/LinqTest.java


Diffs:
------
Index: trunk/impl/src/main/java/com/sun/el/query/Skip.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/query/Skip.java (revision 174)
+++ trunk/impl/src/main/java/com/sun/el/query/Skip.java (revision 175)
@@ -58,6 +58,7 @@
                     @Override
                     void doItem(Object item) {
                         if (index < count) {
+                            next();  // discarded
                             return;
                         }
                         yield(item);
Index: trunk/src/test/java/org/glassfish/el/test/LinqTest.java
===================================================================
--- trunk/src/test/java/org/glassfish/el/test/LinqTest.java     (revision 174)
+++ trunk/src/test/java/org/glassfish/el/test/LinqTest.java     (revision 175)
@@ -82,6 +82,13 @@
         assertTrue(indx == expected.length);
     }
 
+    static String exp0[] = {"Coming Home", "Greatest Hits",
+                       "History of Golf", "Toy Story" , "iSee"};
+    @Test
+    public void testSkip() {
+        testIterable("skip", "products.skip(1).select(p->p.name)", exp0);
+    }
+    
     static String[] exp1 = {
         "Product: 200, Eagle, book, 12.5, 100",
         "Product: 203, History of Golf, book, 11.0, 30",





[el-spec commits] [el-spec~source-code:175] Fix skip issue.

kchung 07/19/2012
 
 
Close
loading
Please Confirm
Close