vgritsenko 2003/01/27 17:18:33 Modified: src/java/org/apache/cocoon/util/log CocoonLogFormatter.java XMLCocoonLogFormatter.java Log: remove unused variable and add some javadoc Revision Changes Path 1.7 +3 -4 xml-cocoon2/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java Index: CocoonLogFormatter.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- CocoonLogFormatter.java 26 Jun 2002 22:25:56 -0000 1.6 +++ CocoonLogFormatter.java 28 Jan 2003 01:18:33 -0000 1.7 @@ -76,7 +76,6 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a> * @version CVS $Id$ */ - public class CocoonLogFormatter extends ExtensiblePatternFormatter { protected final static int TYPE_CLASS = MAX_TYPE + 1; @@ -104,8 +103,9 @@ * stack. The element at index 0 is the class of the currently executing * method, the element at index 1 is the class of that method's caller, * and so on. + * + * @return current execution stack as an array of classes. */ - public Class[] get() { return getClassContext(); @@ -260,5 +260,4 @@ { return this.dateFormatter.format(new Date()); } - } 1.7 +9 -15 xml-cocoon2/src/java/org/apache/cocoon/util/log/XMLCocoonLogFormatter.java Index: XMLCocoonLogFormatter.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/util/log/XMLCocoonLogFormatter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- XMLCocoonLogFormatter.java 22 Feb 2002 07:03:58 -0000 1.6 +++ XMLCocoonLogFormatter.java 28 Jan 2003 01:18:33 -0000 1.7 @@ -293,10 +293,11 @@ * Find the thread that is logged this event. */ private String getThread(ContextMap ctxMap) { - if (ctxMap != null&& ctxMap.get("threadName") != null) + if (ctxMap != null && ctxMap.get("threadName") != null) { return (String)ctxMap.get("threadName"); - else + } else { return "Unknown-thread"; + } } /** @@ -342,17 +343,9 @@ } else { // this is not the best implementation, but it works... StringTokenizer st = new StringTokenizer(typeString); - int i = 0; - while (st.hasMoreTokens()) { - String s = st.nextToken(); - i++; - } - st = new StringTokenizer(typeString); - this.types = new int[i]; - i = 0; - while (st.hasMoreTokens()) { + this.types = new int[st.countTokens()]; + for (int i = 0; i < this.types.length; i++) { this.types[i] = this.getTypeIdFor(st.nextToken()); - i++; } } } @@ -360,6 +353,7 @@ /** The class that we will search for in the call stack */ private Class loggerClass = org.apache.log.Logger.class; private CallStack callStack = new CallStack(); + /** * Hack to get the call stack as an array of classes. The * SecurityManager class provides it as a protected method, so @@ -373,12 +367,12 @@ * stack. The element at index 0 is the class of the currently executing * method, the element at index 1 is the class of that method's caller, * and so on. + * + * @return current execution stack as an array of classes. */ - public Class[] get() { return getClassContext(); } } - }
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]