[Dive4elements-commits] [PATCH] Datacage: Fixed addColumn in <dc:virtual-column>

Wald Commits scm-commit at wald.intevation.org
Fri May 24 18:13:53 CEST 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1369412003 -7200
# Node ID bdb316f7c552dad38013247a0e40397ea12d49a6
# Parent  75a38bc6baf2172a68720db63cb200739529a13a
Datacage: Fixed addColumn in <dc:virtual-column>

diff -r 75a38bc6baf2 -r bdb316f7c552 artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java	Fri May 24 13:57:40 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java	Fri May 24 18:13:23 2013 +0200
@@ -517,6 +517,7 @@
             String [] origColumns = rd.getColumnLabels();
             int index = origColumns.length;
             String [] newColumns = Arrays.copyOf(origColumns, index+1);
+            newColumns[index] = name.toLowerCase();
             ResultData result = new ResultData(newColumns);
             fillResult(result, rd, index, index+1, expr, returnType);
             return result;
@@ -535,17 +536,15 @@
         }
 
         protected void fillResult(
-            ResultData result,
-            ResultData rd,
-            int        index,
-            int size,
+            ResultData      result,
+            ResultData      rd,
+            int             index,
+            int             size,
             XPathExpression expr,
-            QName returnType
+            QName           returnType
         ) {
-            List<Object []> rows = rd.getRows();
             String [] origColumns = rd.getColumnLabels();
-            for (int i = 0, R = rows.size(); i < R; ++i) {
-                Object [] row = rows.get(i);
+            for (Object [] row: rd.getRows()) {
                 frames.enter();
                 try {
                     frames.put(origColumns, row);


More information about the Dive4elements-commits mailing list