From 6a526416ca73ffee884ad1744f6c2f3376264781 Mon Sep 17 00:00:00 2001 From: cchantep Date: Wed, 12 Feb 2014 14:00:19 +0100 Subject: [PATCH] [studio] Fix row column cursor in formatting --- studio/src/main/java/acolyte/RowFormatter.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/studio/src/main/java/acolyte/RowFormatter.java b/studio/src/main/java/acolyte/RowFormatter.java index 6bae4134..1c2ded6f 100644 --- a/studio/src/main/java/acolyte/RowFormatter.java +++ b/studio/src/main/java/acolyte/RowFormatter.java @@ -223,7 +223,7 @@ static void appendNull(final Appender ap, /** * Result set values. */ - static void appendValues(final Iterator it, + static void appendValues(final ResultRow rs, final Appender ap, final Charset charset, final Formatting fmt, @@ -241,11 +241,10 @@ static void appendValues(final Iterator it, } // end of if final ColumnType col = cols.next(); - final ResultRow rs = it.next(); if (rs.isNull(colIndex)) { appendNull(ap, fmt, col); - appendValues(it, ap, charset, fmt, cols, colIndex+1); + appendValues(rs, ap, charset, fmt, cols, colIndex+1); return; } // end of if @@ -316,7 +315,7 @@ static void appendValues(final Iterator it, break; } // end of switch - appendValues(it, ap, charset, fmt, cols, colIndex+1); + appendValues(rs, ap, charset, fmt, cols, colIndex+1); } // end of appendValues /** @@ -336,7 +335,7 @@ protected static void appendRows(final Iterator it, ap.append(" "); ap.append(fmt.rowStart); - appendValues(it, ap, charset, fmt, cols.iterator(), 0); + appendValues(it.next(), ap, charset, fmt, cols.iterator(), 0); ap.append(fmt.rowEnd); } // end of while