diff -urPwb orig/BuildComposablePipeline.java new/BuildComposablePipeline.java --- orig/BuildComposablePipeline.java 2003-06-08 21:27:10.000000000 +0200 +++ new/BuildComposablePipeline.java 2003-06-21 18:56:35.000000000 +0200 @@ -466,7 +466,26 @@ protected void postMethodEmissionHook(PrintWriter output) { output.println("private PrintStream " + getOutputStreamName() + ";"); + output.println("protected String dumpArray(Object obj)"); + output.println("{"); + output.println(" StringBuffer sb = new StringBuffer(\"[\");"); + output.println(" int len = java.lang.reflect.Array.getLength(obj);"); + output.println(" int count = Math.min(len,16);"); + output.println(" for ( int i =0; i < count; i++ ) {"); + output.println(" sb.append(java.lang.reflect.Array.get(obj,i));"); + output.println(" if (i < count-1)"); + output.println(" sb.append(',');"); + output.println(" }"); + output.println(" if ( len > 16 )"); + output.println(" sb.append(\"...\").append(len);"); + output.println(" sb.append(']');"); + output.println(" return sb.toString();"); + output.println("}"); + } + + + protected void emitClassDocComment(PrintWriter output) { output.println("/**

Composable pipline which wraps an underlying {@link GL} implementation,"); @@ -481,13 +500,33 @@ protected void preDownstreamCallHook(PrintWriter output, Method m) { - output.println(getOutputStreamName() + ".println(\"Entered " + m.getName() + "\");"); + Class[] params = m.getParameterTypes(); + + output.print(getOutputStreamName() + ".print(\"" + m.getName() + "(\""); + for ( int i =0; i < params.length; i++ ) + { + if ( params[i].isArray() ) + output.print("+dumpArray(arg"+i+")"); + else + output.print("+arg"+i); + if ( i < params.length-1) + output.print("+\",\""); + } + output.println("+\")\");"); output.print(" "); } protected void postDownstreamCallHook(PrintWriter output, Method m) { - output.println(" " + getOutputStreamName() + ".println(\"Exited " + m.getName() + "\");"); + Class ret = m.getReturnType(); + if ( ret != Void.TYPE ) + { + output.println(" "+getOutputStreamName() + ".println(\" = \"+_res);"); + } + else + { + output.println(" "+getOutputStreamName() + ".println();"); + } } private String getOutputStreamName() {