incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1167039 - in /incubator/lcf/trunk: ./ CHANGES.txt framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfigurationNode.java
Date Fri, 09 Sep 2011 08:35:06 GMT
Author: kwright
Date: Fri Sep  9 08:35:06 2011
New Revision: 1167039

URL: http://svn.apache.org/viewvc?rev=1167039&view=rev
Log:
Fix for CONNECTORS-253.  Order script output of configurationnode objects in script engine.

Modified:
    incubator/lcf/trunk/   (props changed)
    incubator/lcf/trunk/CHANGES.txt
    incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfigurationNode.java

Propchange: incubator/lcf/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  9 08:35:06 2011
@@ -6,4 +6,5 @@
 /incubator/lcf/branches/CONNECTORS-223:1146689-1146810
 /incubator/lcf/branches/CONNECTORS-224:1154884-1158633
 /incubator/lcf/branches/CONNECTORS-236:1153921-1154314
+/incubator/lcf/branches/CONNECTORS-240:1163953-1166425
 /incubator/lcf/branches/CONNECTORS-32:1092556-1094216

Modified: incubator/lcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/CHANGES.txt?rev=1167039&r1=1167038&r2=1167039&view=diff
==============================================================================
--- incubator/lcf/trunk/CHANGES.txt (original)
+++ incubator/lcf/trunk/CHANGES.txt Fri Sep  9 08:35:06 2011
@@ -5,6 +5,10 @@ $Id$
 
 ======================= Release 0.3 =========================
 
+CONNECTORS-253: Make script output of configurationnode script object
+have attributes that are ordered, so the test does not depend on hash order.
+(Shinichiro Abe, Karl Wright)
+
 CONNECTORS-246, CONNECTORS-248, CONNECTORS-249: Problems with MVCC
 model of Hsqldb causing query inconsistencies, fixed in HSQLDB 2.2.5-6-9-2011.
 (Fred Toussi, Karl Wright)

Modified: incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfigurationNode.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfigurationNode.java?rev=1167039&r1=1167038&r2=1167039&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfigurationNode.java
(original)
+++ incubator/lcf/trunk/framework/script-engine/src/main/java/org/apache/manifoldcf/scriptengine/VariableConfigurationNode.java
Fri Sep  9 08:35:06 2011
@@ -53,9 +53,18 @@ public class VariableConfigurationNode e
     sb.append(" : ");
     boolean needComma = false;
     Iterator<String> iter = configurationNode.getAttributes();
+    String[] attrs = new String[configurationNode.getAttributeCount()];
+    int i = 0;
     while (iter.hasNext())
     {
       String attrName = iter.next();
+      attrs[i++] = attrName;
+    }
+    java.util.Arrays.sort(attrs);
+    i = 0;
+    while (i < attrs.length)
+    {
+      String attrName = attrs[i++];
       String value = configurationNode.getAttributeValue(attrName);
       if (needComma)
         sb.append(", ");
@@ -66,7 +75,7 @@ public class VariableConfigurationNode e
       sb.append(new VariableString(value).getScriptValue());
     }
     sb.append(" : ");
-    int i = 0;
+    i = 0;
     while (i < configurationNode.getChildCount())
     {
       ConfigurationNode child = configurationNode.findChild(i);



Mime
View raw message