pass correct range to sort()
[org.ibex.core.git] / src / org / ibex / core / Template.java
index 1b70f30..a59e99d 100644 (file)
@@ -259,7 +259,7 @@ public class Template {
             // sort the attributes lexicographically
             Basket.Array.sort(keys, vals, new Basket.CompareFunc() {
                 public int compare(Object a, Object b) { return ((String)a).compareTo((String)b); }
-            }, 0, keys.size());
+            }, 0, keys.size() - 1);
 
             t.keys = new JS[keys.size()];
             t.vals = new JS[vals.size()];