graveyard/tools/org/apache/axis/tools/trace/Tracer.java
/**
	 * Takes in the return statement and traces out the exit trace statement for it
	 * This method prints out the complete return line as well so the user
	 * does not need to print this out themselves. 
	 */
Takes in the return statement and traces out the exit trace statement for it
This method prints out the complete return line as well so the user
does not need to print this out themselves.
Takes in the return statement and traces out the exit trace statement for it This method prints out the complete return line as well so the user does not need to print this out themselves .
void traceExit(String value, int returnIndex) throws Exception {
		if (!signature.traceable())
			return;
		if (null == signature.getReturnType().getType())
			Utils.rude(
				"Expecting to return a value from a method that returns void: "
					+ signature.toString());
		String that = "NULL";
		if (headers.isInstanceMethod(signature))
			that = "this";
		String line = "\t{\n";
		line += "\t\t" + hashifdef;
		line += "\t\t\t"
			+ signature.getReturnType().getType()
			+ " traceRet = ("
			+ value
			+ ");\n";
		line += "\t\t\tif (" + namespace + module + "isTraceOn())\n";
		line += "\t\t\t\t"
			+ namespace
			+ module
			+ "traceExit("
			+ getClassName()
			+ ", \""
			+ signature.getMethodName()
			+ "\", "
			+ that
			+ ", "
			+ returnIndex
			+ getTypeParms(signature.getReturnType(), true)
			+ ");\t"
			+ SIGNATURE
			+ "\n";
		line += "\t\t\treturn traceRet;\n";
		line += "\t\t" + hashelse;
		if (hashelse.length() > 0)
			line += "\t\t\treturn " + value + ";\n";
		line += "\t\t" + hashendif;
		line += "\t}\n";
		writeTrace(line);
		flush();
	}
void traceExit ( String value , int returnIndex ) throws Exception { if ( ! signature . traceable ( ) ) return ; if ( null == signature . getReturnType ( ) . getType ( ) ) Utils . rude ( "Expecting to return a value from a method that returns void: " + signature . toString ( ) ) ; String that = "NULL" ; if ( headers . isInstanceMethod ( signature ) ) that = "this" ; String line = "\t{\n" ; line += "\t\t" + hashifdef ; line += "\t\t\t" + signature . getReturnType ( ) . getType ( ) + " traceRet = (" + value + ");\n" ; line += "\t\t\tif (" + namespace + module + "isTraceOn())\n" ; line += "\t\t\t\t" + namespace + module + "traceExit(" + getClassName ( ) + ", \"" + signature . getMethodName ( ) + "\", " + that + ", " + returnIndex + getTypeParms ( signature . getReturnType ( ) , true ) + ");\t" + SIGNATURE + "\n" ; line += "\t\t\treturn traceRet;\n" ; line += "\t\t" + hashelse ; if ( hashelse . length ( ) > 0 ) line += "\t\t\treturn " + value + ";\n" ; line += "\t\t" + hashendif ; line += "\t}\n" ; writeTrace ( line ) ; flush ( ) ; }
Takes in the return statement and traces out the exit trace statement for it
 This method prints out the complete return line as well so the user
 does not need to print this out themselves.
Takes in the return statement and traces out the exit trace statement for it This method prints out the complete return line as well so the user does not need to print this out themselves .
// Check this method doesn't return void
 // Enclose the printf/return in {} in case if/then doesn't have {}
 // Copy the return value into a local called traceRet in case the
 // return value has side-effects such as "return i++;" or "return func();"
 // This makes sure that we don't execute the return value twice.
 // Unfortunately if the return value is a class we will invoke 
 // a copy constructor. When initialising traceRet with value, put value
 // in brackets in case it contains an operator that might be invoked
 // after the assignment, like another assignment.
