commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r604246 - /commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java
Date Fri, 14 Dec 2007 18:19:24 GMT
Author: mbenson
Date: Fri Dec 14 10:19:23 2007
New Revision: 604246

URL: http://svn.apache.org/viewvc?rev=604246&view=rev
Log:
refactor NodeSet handling

Modified:
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java?rev=604246&r1=604245&r2=604246&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java
(original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java
Fri Dec 14 10:19:23 2007
@@ -309,6 +309,9 @@
         if (value instanceof NodePointer) {
             value = ((NodePointer) value).getValue();
         }
+        if (value instanceof NodeSet) {
+            value = ((NodeSet) value).getPointers();
+        }
         if (value instanceof EvalContext) {
             EvalContext ctx = (EvalContext) value;
             while (ctx.hasNext()) {
@@ -318,9 +321,6 @@
         }
         else if (value instanceof Collection) {
             count = ((Collection) value).size();
-        }
-        else if (value instanceof NodeSet) {
-            count = ((NodeSet) value).getPointers().size();
         }
         else if (value == null) {
             count = 0;



Mime
View raw message