jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r391564 - /jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
Date Wed, 05 Apr 2006 08:49:43 GMT
Author: mreutegg
Date: Wed Apr  5 01:49:42 2006
New Revision: 391564

URL: http://svn.apache.org/viewcvs?rev=391564&view=rev
Log:
JCR-386: Query dump failed with deep query tree

Modified:
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java?rev=391564&r1=391563&r2=391564&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
Wed Apr  5 01:49:42 2006
@@ -24,14 +24,23 @@
  */
 public class QueryTreeDump implements QueryNodeVisitor {
 
-    /** Current indentation level */
+    /**
+     * Current indentation level
+     */
     private int indent;
 
-    /** Padding array filled with spaces */
-    private static final char[] PADDING = new char[255];
+    /**
+     * Padding array filled with spaces
+     */
+    private static char[] PADDING = new char[255];
+
+    /**
+     * The padding character: whitespace.
+     */
+    private static final char PADDING_CHAR = ' ';
 
     static {
-        Arrays.fill(PADDING, ' ');
+        Arrays.fill(PADDING, PADDING_CHAR);
     }
 
     /**
@@ -259,6 +268,11 @@
 
     private void traverse(QueryNode[] node, StringBuffer buffer) {
         indent += 2;
+        if (indent > PADDING.length) {
+            char[] tmp = new char[indent * 2];
+            Arrays.fill(tmp, PADDING_CHAR);
+            PADDING = tmp;
+        }
         for (int i = 0; i < node.length; i++) {
             node[i].accept(this, buffer);
         }



Mime
View raw message