Skip to main content

[el-spec commits] [el-spec~source-code:56] Minor trigs.

  • From: kchung@...
  • To: commits@...
  • Subject: [el-spec commits] [el-spec~source-code:56] Minor trigs.
  • Date: Tue, 13 Mar 2012 18:07:49 +0000

Project:    el-spec
Repository: source-code
Revision:   56
Author:     kchung
Date:       2012-03-13 18:07:47 UTC
Link:       

Log Message:
------------
Minor trigs.



Revisions:
----------
56


Modified Paths:
---------------
trunk/impl/src/main/java/com/sun/el/query/ThenByDescending.java
trunk/impl/src/main/java/com/sun/el/query/ThenBy.java
trunk/impl/src/main/java/com/sun/el/query/GroupBy.java
trunk/impl/src/main/java/com/sun/el/query/OrderIterable.java
trunk/impl/src/main/java/com/sun/el/query/BaseSetIterator.java


Diffs:
------
Index: trunk/impl/src/main/java/com/sun/el/query/BaseSetIterator.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/query/BaseSetIterator.java      
(revision 55)
+++ trunk/impl/src/main/java/com/sun/el/query/BaseSetIterator.java      
(revision 56)
@@ -52,7 +52,6 @@
     private Iterator<Object> iter;
     private Object current;
     private boolean yielded;
-    private boolean yieldBreak;
     private int state = 1;
 
     BaseSetIterator(Iterable<Object> first, Iterable<Object> second){
Index: trunk/impl/src/main/java/com/sun/el/query/ThenByDescending.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/query/ThenByDescending.java     
(revision 55)
+++ trunk/impl/src/main/java/com/sun/el/query/ThenByDescending.java     
(revision 56)
@@ -57,11 +57,9 @@
         final LambdaExpression keySelector = getLambda("thenByDescending", 
params, 0);
         final Comparator<Object> cmp = getComparator("thenByDescending", 
params, 1, true);
 
-        if (!(base instanceof OrderIterable)) {
-            return base;
+        if (base instanceof OrderIterable) {
+            ((OrderIterable) base).addOrder(keySelector, cmp, true);
         }
-
-        ((OrderIterable) base).addOrder(keySelector, cmp, true);
         return base;
     }
 }
Index: trunk/impl/src/main/java/com/sun/el/query/OrderIterable.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/query/OrderIterable.java        
(revision 55)
+++ trunk/impl/src/main/java/com/sun/el/query/OrderIterable.java        
(revision 56)
@@ -51,13 +51,13 @@
 import javax.el.LambdaExpression;
 import javax.el.ELContext;
 
-/*
- * This implements the operators orderedBy and thenBy, orderByDescending and
+/**
+ * Implements the operators orderedBy, thenBy, orderByDescending and
  * thenByDescending operators.
  *
  * To avoid unnecessary intermediate sortings, the key selectors and the key
  * comparators are kept in a list and only applied on the last operator, when
- * the iterator of the final Iterable is needed.
+ * the iterator of the final Iterable is enumerated.
  *
  * A Comparator is used to handle the sorting of the primary and secondary
  * keys.
Index: trunk/impl/src/main/java/com/sun/el/query/GroupBy.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/query/GroupBy.java      (revision 55)
+++ trunk/impl/src/main/java/com/sun/el/query/GroupBy.java      (revision 56)
@@ -93,7 +93,6 @@
         GroupingImpl<Object, Object> g = new 
GroupingImpl<Object,Object>(key);
         g.add(value);
         groups.add(g);
-        return;
     }
 }
 
Index: trunk/impl/src/main/java/com/sun/el/query/ThenBy.java
===================================================================
--- trunk/impl/src/main/java/com/sun/el/query/ThenBy.java       (revision 55)
+++ trunk/impl/src/main/java/com/sun/el/query/ThenBy.java       (revision 56)
@@ -57,11 +57,9 @@
         final LambdaExpression keySelector = getLambda("thenBy", params, 0);
         final Comparator<Object> cmp = getComparator("thenBy", params, 1, 
true);
 
-        if (!(base instanceof OrderIterable)) {
-            return base;
+        if (base instanceof OrderIterable) {
+            ((OrderIterable) base).addOrder(keySelector, cmp, false);
         }
-
-        ((OrderIterable) base).addOrder(keySelector, cmp, false);
         return base;
     }
 }





[el-spec commits] [el-spec~source-code:56] Minor trigs.

kchung 03/13/2012
 
 
Close
loading
Please Confirm
Close