jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r409538 - /jackrabbit/branches/1.0/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
Date Fri, 26 May 2006 02:00:45 GMT
Author: jukka
Date: Thu May 25 19:00:45 2006
New Revision: 409538

URL: http://svn.apache.org/viewvc?rev=409538&view=rev
Log:
1.0: Merged revision 391564: JCR-386

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

Modified: jackrabbit/branches/1.0/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.0/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java?rev=409538&r1=409537&r2=409538&view=diff
==============================================================================
--- jackrabbit/branches/1.0/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
(original)
+++ jackrabbit/branches/1.0/jackrabbit/src/main/java/org/apache/jackrabbit/core/query/QueryTreeDump.java
Thu May 25 19:00:45 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