hello all,

the attached patch --already committed-- fixes a typo, and replaces 
writing to System.out with logging statements conditioned by 
Configuration.DEBUG.

2006-06-14  Raif S. Naffah  <[EMAIL PROTECTED]>

        * gnu/javax/security/auth/login/ConfigFileTokenizer.java: Fixed a typo.
        Condition all trace/debug code based on Configuration.DEBUG.
        Use logger instead of STDOUT and ot STDERR.


cheers;
rsn
Index: ConfigFileTokenizer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/security/auth/login/ConfigFileTokenizer.java,v
retrieving revision 1.1
diff -u -r1.1 ConfigFileTokenizer.java
--- ConfigFileTokenizer.java	15 Jan 2006 19:42:52 -0000	1.1
+++ ConfigFileTokenizer.java	14 Jun 2006 09:49:56 -0000
@@ -38,14 +38,17 @@
 
 package gnu.javax.security.auth.login;
 
+import gnu.classpath.Configuration;
+
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.Reader;
+import java.util.logging.Logger;
 
 /**
  * A UTF-8 friendly, JAAS Login Module Configuration file tokenizer written in
  * the deault syntax. This class emulates, to a certain extent, the behavior of
- * a [EMAIL PROTECTED] java.io.SrteamTokenizer} instance <code>st</code>, when set as
+ * a [EMAIL PROTECTED] java.io.StreamTokenizer} instance <code>st</code>, when set as
  * follows:
  * 
  *  <pre>
@@ -76,12 +79,7 @@
  */
 public class ConfigFileTokenizer
 {
-  // Constants and fields
-  // --------------------------------------------------------------------------
-
-  private static final boolean DEBUG = false;
-  private static final void debug(String m) {if (DEBUG) System.err.println(m);};
-
+  private static final Logger log = Logger.getLogger(ConfigFileParser.class.getName());
   /** A constant indicating that the end of the stream has been read. */
   public static final int TT_EOF = -1;
   /** A constant indicating that a word token has been read. */
@@ -235,9 +233,12 @@
 
   private void abort(String m) throws IOException
   {
-    debug("DEBUG: " + m);
-    debug("DEBUG: sb = " + sb);
-    debug("DEBUG: sbNdx = " + sbNdx);
+    if (Configuration.DEBUG)
+      {
+        log.fine(m);
+        log.fine("sb = " + sb);
+        log.fine("sbNdx = " + sbNdx);
+      }
     throw new IOException(m);
   }
 }

Reply via email to