geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r410173 - /geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/LoggingVisitor.java
Date Tue, 30 May 2006 02:33:22 GMT
Author: jdillon
Date: Mon May 29 19:33:22 2006
New Revision: 410173

URL: http://svn.apache.org/viewvc?rev=410173&view=rev
Log:
Simplify node logging impl

Modified:
    geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/LoggingVisitor.java

Modified: geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/LoggingVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/LoggingVisitor.java?rev=410173&r1=410172&r2=410173&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/LoggingVisitor.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/LoggingVisitor.java
Mon May 29 19:33:22 2006
@@ -75,9 +75,7 @@
         log.debug(buff);
     }
 
-    public Object visit(final SimpleNode node, Object data) {
-        log(SimpleNode.class, node, data);
-
+    private Object logChildren(final SimpleNode node, Object data) {
         indent++;
         data = node.childrenAccept(this, data);
         indent--;
@@ -85,53 +83,33 @@
         return data;
     }
 
+    public Object visit(final SimpleNode node, Object data) {
+        log(SimpleNode.class, node, data);
+        return logChildren(node, data);
+    }
+
     public Object visit(final ASTCommandLine node, Object data) {
         log(ASTCommandLine.class, node, data);
-
-        indent++;
-        data = node.childrenAccept(this, data);
-        indent--;
-
-        return data;
+        return logChildren(node, data);
     }
 
     public Object visit(final ASTExpression node, Object data) {
         log(ASTExpression.class, node, data);
-
-        indent++;
-        data = node.childrenAccept(this, data);
-        indent--;
-
-        return data;
+        return logChildren(node, data);
     }
 
     public Object visit(final ASTQuotedString node, Object data) {
         log(ASTQuotedString.class, node, data);
-
-        indent++;
-        data = node.childrenAccept(this, data);
-        indent--;
-
-        return data;
+        return logChildren(node, data);
     }
 
     public Object visit(final ASTOpaqueString node, Object data) {
         log(ASTOpaqueString.class, node, data);
-
-        indent++;
-        data = node.childrenAccept(this, data);
-        indent--;
-
-        return data;
+        return logChildren(node, data);
     }
 
     public Object visit(final ASTPlainString node, Object data) {
         log(ASTPlainString.class, node, data);
-
-        indent++;
-        data = node.childrenAccept(this, data);
-        indent--;
-
-        return data;
+        return logChildren(node, data);
     }
 }



Mime
View raw message