commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sand...@apache.org
Subject cvs commit: jakarta-commons/digester/src/test/org/apache/commons/digester/xmlrules DigesterLoaderTest.java
Date Fri, 04 Jan 2002 05:32:12 GMT
sanders     02/01/03 21:32:11

  Modified:    digester build.xml
               digester/src/java/org/apache/commons/digester
                        BeanPropertySetterRule.java CallMethodRule.java
                        Digester.java FactoryCreateRule.java
                        ObjectCreateRule.java SetNextRule.java
                        SetPropertiesRule.java SetPropertyRule.java
                        SetTopRule.java
               digester/src/java/org/apache/commons/digester/rss
                        RSSDigester.java
               digester/src/java/org/apache/commons/digester/xmlrules
                        DigesterRuleParser.java FromXmlRuleSet.java
               digester/src/test/org/apache/commons/digester
                        DigesterTestCase.java
               digester/src/test/org/apache/commons/digester/xmlrules
                        DigesterLoaderTest.java
  Removed:     digester/src/java/org/apache/commons/digester/xmlrules
                        NullLogWriter.java
  Log:
  Updated Digester to use the commons logging package.
  
  Revision  Changes    Path
  1.18      +10 -2     jakarta-commons/digester/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/build.xml,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- build.xml	4 Dec 2001 19:46:11 -0000	1.17
  +++ build.xml	4 Jan 2002 05:32:11 -0000	1.18
  @@ -3,7 +3,7 @@
   
   <!--
           "Digester" component of the Jakarta Commons Subproject
  -        $Id: build.xml,v 1.17 2001/12/04 19:46:11 sanders Exp $
  +        $Id: build.xml,v 1.18 2002/01/04 05:32:11 sanders Exp $
   -->
   
   
  @@ -24,6 +24,7 @@
     <property name="commons.home"            value=".."/>
     <property name="beanutils.home"          value="${commons.home}/beanutils"/>
     <property name="collections.home"        value="${commons.home}/collections"/>
  +  <property name="logging.home"            value="${commons.home}/logging"/>
   
   
   <!-- ========== Derived Values ============================================ -->
  @@ -37,6 +38,8 @@
     <property name="commons-beanutils.jar"   value="${beanutils.home}/dist/commons-beanutils.jar"/>
     <property name="commons-collections.api" value="${collections.home}/dist/docs/api"/>
     <property name="commons-collections.jar" value="${collections.home}/dist/commons-collections.jar"/>
  +  <property name="commons-logging.api"     value="${logging.home}/dist/docs/api"/>
  +  <property name="commons-logging.jar"     value="${logging.home}/dist/commons-logging.jar"/>
   
   
   <!-- ========== Component Declarations ==================================== -->
  @@ -49,7 +52,7 @@
     <property name="component.package"       value="org.apache.commons.digester"/>
   
     <!-- The title of this component -->
  -  <property name="component.title"         value="XML to Java Object Configuration"/>
  +  <property name="component.title"         value="Digester - XML to Java Object Configuration"/>
   
     <!-- The current version number of this component -->
     <property name="component.version"       value="1.2-dev"/>
  @@ -89,6 +92,7 @@
       <pathelement location="${jaxp.parser.jar}"/>
       <pathelement location="${commons-beanutils.jar}"/>
       <pathelement location="${commons-collections.jar}"/>
  +    <pathelement location="${commons-logging.jar}"/>
       <pathelement location="${junit.jar}"/>
     </path>
   
  @@ -105,6 +109,7 @@
       <pathelement location="${jaxp.parser.jar}"/>
       <pathelement location="${commons-beanutils.jar}"/>
       <pathelement location="${commons-collections.jar}"/>
  +    <pathelement location="${commons-logging.jar}"/>
     </path>
   
     <!-- Construct RSSDigester test classpath -->
  @@ -114,6 +119,7 @@
       <pathelement location="${jaxp.parser.jar}"/>
       <pathelement location="${commons-beanutils.jar}"/>
       <pathelement location="${commons-collections.jar}"/>
  +    <pathelement location="${commons-logging.jar}"/>
     </path>
   
     <!-- Should all tests fail if one does? -->
  @@ -211,6 +217,8 @@
                      href="http://jakarta.apache.org/commons/beanutils/api/"/>
         <link     offline="true" packagelistLoc="${commons-collections.api}"
                      href="http://jakarta.apache.org/commons/collections/api/"/>
  +      <link     offline="true" packagelistLoc="${commons-logging.api}"
  +                   href="http://jakarta.apache.org/commons/logging/api/"/>
         <classpath  refid="compile.classpath"/>
       </javadoc>
     </target>
  
  
  
  1.3       +9 -10     jakarta-commons/digester/src/java/org/apache/commons/digester/BeanPropertySetterRule.java
  
  Index: BeanPropertySetterRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/BeanPropertySetterRule.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BeanPropertySetterRule.java	4 Dec 2001 18:01:47 -0000	1.2
  +++ BeanPropertySetterRule.java	4 Jan 2002 05:32:11 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/BeanPropertySetterRule.java,v 1.2 2001/12/04 18:01:47 jstrachan Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/12/04 18:01:47 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/BeanPropertySetterRule.java,v 1.3 2002/01/04 05:32:11 sanders Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/01/04 05:32:11 $
    *
    * ====================================================================
    *
  @@ -80,7 +80,7 @@
    * on the parent object.</p>
    *
    * @author Robert Burrell Donkin
  - * @version $Revision: 1.2 $ $Date: 2001/12/04 18:01:47 $
  + * @version $Revision: 1.3 $ $Date: 2002/01/04 05:32:11 $
    */
   
   public class BeanPropertySetterRule extends Rule {
  @@ -143,8 +143,8 @@
       public void body(String bodyText) throws Exception {
   
               // log some debugging information
  -            if (digester.debug>9)
  -                digester.log("[BeanPropertySetterRule] Called with text " +
  +            if (digester.log.isDebugEnabled())
  +                digester.log.debug("[BeanPropertySetterRule] Called with text " +
                                bodyText);
   
   	    this.bodyText = bodyText.trim();
  @@ -172,8 +172,7 @@
   	}
   
           // log some debugging information
  -        if (digester.debug>1)
  -            digester.log("[BeanPropertySetterRule] setting property " +
  +        digester.log.info("[BeanPropertySetterRule] setting property " +
                            property + " with text " + bodyText);
   
           // going to use beanutils so need to specify property using map
  @@ -185,8 +184,8 @@
           if (top==null) {
               // don't try to set property if null
               // just log and return
  -            if (digester.debug>3)
  -                digester.log("[BeanPropertySetterRule] Top object is null.");
  +            if (digester.log.isDebugEnabled())
  +                digester.log.debug("[BeanPropertySetterRule] Top object is null.");
               return;
           }
           
  
  
  
  1.12      +6 -6      jakarta-commons/digester/src/java/org/apache/commons/digester/CallMethodRule.java
  
  Index: CallMethodRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallMethodRule.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CallMethodRule.java	15 Dec 2001 19:45:56 -0000	1.11
  +++ CallMethodRule.java	4 Jan 2002 05:32:11 -0000	1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallMethodRule.java,v 1.11 2001/12/15 19:45:56 craigmcc Exp $
  - * $Revision: 1.11 $
  - * $Date: 2001/12/15 19:45:56 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallMethodRule.java,v 1.12 2002/01/04 05:32:11 sanders Exp $
  + * $Revision: 1.12 $
  + * $Date: 2002/01/04 05:32:11 $
    *
    * ====================================================================
    *
  @@ -78,7 +78,7 @@
    *
    * @author Craig McClanahan
    * @author Scott Sanders
  - * @version $Revision: 1.11 $ $Date: 2001/12/15 19:45:56 $
  + * @version $Revision: 1.12 $ $Date: 2002/01/04 05:32:11 $
    */
   
   public class CallMethodRule extends Rule {
  @@ -283,7 +283,7 @@
   
   	// Invoke the required method on the top object
   	Object top = digester.peek();
  -	if (digester.getDebug() >= 1) {
  +	if (digester.log.isDebugEnabled()) {
   	    StringBuffer sb = new StringBuffer("Call ");
               if (top == null)
                   sb.append("[NULL TOP]");
  @@ -306,7 +306,7 @@
                       sb.append(paramTypes[i].getName());
   	    }
   	    sb.append(")");
  -	    digester.log(sb.toString());
  +	    digester.log.debug(sb.toString());
   	}
           MethodUtils.invokeExactMethod(top, methodName,
                                         paramValues, paramTypes);
  
  
  
  1.31      +117 -166  jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java
  
  Index: Digester.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Digester.java	4 Jan 2002 02:34:08 -0000	1.30
  +++ Digester.java	4 Jan 2002 05:32:11 -0000	1.31
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v 1.30 2002/01/04 02:34:08 sanders Exp $
  - * $Revision: 1.30 $
  - * $Date: 2002/01/04 02:34:08 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java,v 1.31 2002/01/04 05:32:11 sanders Exp $
  + * $Revision: 1.31 $
  + * $Date: 2002/01/04 05:32:11 $
    *
    * ====================================================================
    *
  @@ -80,6 +80,9 @@
   import javax.xml.parsers.SAXParser;
   import javax.xml.parsers.SAXParserFactory;
   import org.apache.commons.collections.ArrayStack;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogSource;
  +import org.apache.commons.logging.NoOpLog;
   import org.xml.sax.Attributes;
   import org.xml.sax.ContentHandler;
   import org.xml.sax.EntityResolver;
  @@ -109,7 +112,7 @@
    *
    * @author Craig McClanahan
    * @author Scott Sanders
  - * @version $Revision: 1.30 $ $Date: 2002/01/04 02:34:08 $
  + * @version $Revision: 1.31 $ $Date: 2002/01/04 05:32:11 $
    */
   
   public class Digester extends DefaultHandler {
  @@ -191,12 +194,6 @@
   
   
       /**
  -     * The debugging detail level of this component.
  -     */
  -    protected int debug = 0;
  -
  -
  -    /**
        * The URLs of DTDs that have been registered, keyed by the public
        * identifier that corresponds.
        */
  @@ -307,11 +304,10 @@
   
   
       /**
  -     * The PrintWriter to which we should send log output, or
  -     * <code>null</code> to write to <code>System.out</code>.
  +     * The Log to which all logging calls will be made.  By default a NoOpLog
  +     * is used, which means no output is done at all.
        */
  -    protected PrintWriter writer = null;
  -
  +    protected Log log = new NoOpLog();
   
       // ----------------------------------------------------------- Properties
   
  @@ -401,45 +397,43 @@
   
   
       /**
  -     * Return the debugging detail level of this Digester.
  +     * Return the error handler for this Digester.
        */
  -    public int getDebug() {
  +    public ErrorHandler getErrorHandler() {
   
  -        return (this.debug);
  +        return (this.errorHandler);
   
       }
   
   
       /**
  -     * Set the debugging detail level of this Digester.
  +     * Set the error handler for this Digester.
        *
  -     * @param debug The new debugging detail level
  +     * @param errorHandler The new error handler
        */
  -    public void setDebug(int debug) {
  +    public void setErrorHandler(ErrorHandler errorHandler) {
   
  -        this.debug = debug;
  +        this.errorHandler = errorHandler;
   
       }
   
   
       /**
  -     * Return the error handler for this Digester.
  +     * Return the current Logger associated with this instance of the Digester
        */
  -    public ErrorHandler getErrorHandler() {
  +    public Log getLogger() {
   
  -        return (this.errorHandler);
  +        return log;
   
       }
   
   
       /**
  -     * Set the error handler for this Digester.
  -     *
  -     * @param errorHandler The new error handler
  +     * Set the current logger for this Digester.
        */
  -    public void setErrorHandler(ErrorHandler errorHandler) {
  +    public void setLogger(Log log) {
   
  -        this.errorHandler = errorHandler;
  +        this.log = log;
   
       }
   
  @@ -523,7 +517,7 @@
                   parser = factory.newSAXParser();
                   return (parser);
               } catch (Exception e) {
  -                log("Digester.getParser: ", e);
  +                log.error("Digester.getParser: ", e);
                   return (null);
               }
           }
  @@ -608,29 +602,6 @@
   
   
       /**
  -     * Return the logging writer for this Digester.
  -     */
  -    public PrintWriter getWriter() {
  -
  -        return (this.writer);
  -
  -    }
  -
  -
  -    /**
  -     * Set the logging writer for this Digester.
  -     *
  -     * @param writer The new PrintWriter, or <code>null</code> for
  -     *  <code>System.out</code>.
  -     */
  -    public void setWriter(PrintWriter writer) {
  -
  -        this.writer = writer;
  -
  -    }
  -
  -
  -    /**
        * Return the boolean as to whether the context classloader should be used.
        */
       public boolean getUseContextClassLoader() {
  @@ -672,8 +643,9 @@
       public void characters(char buffer[], int start, int length)
               throws SAXException {
   
  -        if (debug >= 3)
  -            log("characters(" + new String(buffer, start, length) + ")");
  +        if (log.isInfoEnabled()) {
  +            log.info("characters(" + new String(buffer, start, length) + ")");
  +        }
   
           bodyText.append(buffer, start, length);
   
  @@ -687,11 +659,15 @@
        */
       public void endDocument() throws SAXException {
   
  -        if (debug >= 3)
  -            log("endDocument()");
  +        boolean info = log.isInfoEnabled();
  +        if (info) {
  +            log.info("endDocument()");
  +        }
  +
  +        if (getCount() > 1 && info) {
  +            log.info("endDocument():  " + getCount() + " elements left");
  +        }
   
  -        if (getCount() > 1)
  -            log("endDocument():  " + getCount() + " elements left");
           while (getCount() > 1)
               pop();
   
  @@ -702,10 +678,10 @@
               try {
                   rule.finish();
               } catch (Exception e) {
  -                log("Finish event threw exception", e);
  +                log.error("Finish event threw exception", e);
                   throw createSAXException(e);
               } catch (Throwable t) {
  -                log("Finish event threw exception", t);
  +                log.error("Finish event threw exception", t);
                   throw createSAXException(t.getMessage());
               }
           }
  @@ -731,11 +707,14 @@
       public void endElement(String namespaceURI, String localName,
                              String qName) throws SAXException {
   
  -        if (debug >= 3) {
  -            log("endElement(" + namespaceURI + "," + localName +
  +        boolean info = log.isInfoEnabled();
  +        boolean debug = log.isDebugEnabled();
  +
  +        if (info) {
  +            log.info("endElement(" + namespaceURI + "," + localName +
                       "," + qName + ")");
  -            log("  match='" + match + "'");
  -            log("  bodyText='" + bodyText + "'");
  +            log.info("  match='" + match + "'");
  +            log.info("  bodyText='" + bodyText + "'");
           }
   
           // Fire "body" events for all relevant rules
  @@ -745,26 +724,26 @@
               for (int i = 0; i < rules.size(); i++) {
                   try {
                       Rule rule = (Rule) rules.get(i);
  -                    if (debug >= 4)
  -                        log("  Fire body() for " + rule);
  +                    if (debug)
  +                        log.debug("  Fire body() for " + rule);
                       rule.body(bodyText);
                   } catch (Exception e) {
  -                    log("Body event threw exception", e);
  +                    log.error("Body event threw exception", e);
                       throw createSAXException(e);
                   } catch (Throwable t) {
  -                    log("Body event threw exception", t);
  +                    log.error("Body event threw exception", t);
                       throw createSAXException(t.getMessage());
                   }
               }
           } else {
  -            if (debug >= 3)
  -                log("  No rules found matching '" + match + "'.");
  +            if (info)
  +                log.info("  No rules found matching '" + match + "'.");
           }
   
           // Recover the body text from the surrounding element
           bodyText = (StringBuffer) bodyTexts.pop();
  -        if (debug >= 4)
  -            log("  Popping body text '" + bodyText.toString() + "'");
  +        if (debug)
  +            log.debug("  Popping body text '" + bodyText.toString() + "'");
   
           // Fire "end" events for all relevant rules in reverse order
           if (rules != null) {
  @@ -772,14 +751,14 @@
                   int j = (rules.size() - i) - 1;
                   try {
                       Rule rule = (Rule) rules.get(j);
  -                    if (debug >= 4)
  -                        log("  Fire end() for " + rule);
  +                    if (debug)
  +                        log.debug("  Fire end() for " + rule);
                       rule.end();
                   } catch (Exception e) {
  -                    log("End event threw exception", e);
  +                    log.error("End event threw exception", e);
                       throw createSAXException(e);
                   } catch (Throwable t) {
  -                    log("End event threw exception", t);
  +                    log.error("End event threw exception", t);
                       throw createSAXException(t.getMessage());
                   }
               }
  @@ -804,8 +783,9 @@
        */
       public void endPrefixMapping(String prefix) throws SAXException {
   
  -        if (debug >= 3)
  -            log("endPrefixMapping(" + prefix + ")");
  +        if (log.isInfoEnabled()) {
  +            log.info("endPrefixMapping(" + prefix + ")");
  +        }
   
           // Deregister this prefix mapping
           ArrayStack stack = (ArrayStack) namespaces.get(prefix);
  @@ -835,9 +815,10 @@
       public void ignorableWhitespace(char buffer[], int start, int len)
               throws SAXException {
   
  -        if (debug >= 3)
  -            log("ignorableWhitespace(" +
  +        if (log.isInfoEnabled()) {
  +            log.info("ignorableWhitespace(" +
                       new String(buffer, start, len) + ")");
  +        }
   
           ;	// No processing required
   
  @@ -855,8 +836,9 @@
       public void processingInstruction(String target, String data)
               throws SAXException {
   
  -        if (debug >= 3)
  -            log("processingInstruction('" + target + "','" + data + "')");
  +        if (log.isInfoEnabled()) {
  +            log.info("processingInstruction('" + target + "','" + data + "')");
  +        }
   
           ;	// No processing is required
   
  @@ -870,8 +852,9 @@
        */
       public void setDocumentLocator(Locator locator) {
   
  -        if (debug >= 3)
  -            log("setDocumentLocator(" + locator + ")");
  +        if (log.isInfoEnabled()) {
  +            log.info("setDocumentLocator(" + locator + ")");
  +        }
   
           this.locator = locator;
   
  @@ -887,8 +870,9 @@
        */
       public void skippedEntity(String name) throws SAXException {
   
  -        if (debug >= 3)
  -            log("skippedEntity(" + name + ")");
  +        if (log.isInfoEnabled()) {
  +            log.info("skippedEntity(" + name + ")");
  +        }
   
           ; // No processing required
   
  @@ -902,8 +886,9 @@
        */
       public void startDocument() throws SAXException {
   
  -        if (debug >= 3)
  -            log("startDocument()");
  +        if (log.isInfoEnabled()) {
  +            log.info("startDocument()");
  +        }
   
           ; // No processing required
   
  @@ -927,14 +912,19 @@
                                String qName, Attributes list)
               throws SAXException {
   
  -        if (debug >= 3)
  -            log("startElement(" + namespaceURI + "," + localName + "," +
  +        boolean info = log.isInfoEnabled();
  +        boolean debug = log.isDebugEnabled();
  +
  +        if (info) {
  +            log.info("startElement(" + namespaceURI + "," + localName + "," +
                       qName + ")");
  +        }
   
           // Save the body text accumulated for our surrounding element
           bodyTexts.push(bodyText);
  -        if (debug >= 4)
  -            log("  Pushing body text '" + bodyText.toString() + "'");
  +        if (debug) {
  +            log.debug("  Pushing body text '" + bodyText.toString() + "'");
  +        }
           bodyText = new StringBuffer();
   
           // Compute the current matching rule
  @@ -946,8 +936,9 @@
           else
               sb.append(localName);
           match = sb.toString();
  -        if (debug >= 3)
  -            log("  New match='" + match + "'");
  +        if (info) {
  +            log.info("  New match='" + match + "'");
  +        }
   
           // Fire "begin" events for all relevant rules
           List rules = getRules().match(namespaceURI, match);
  @@ -956,20 +947,22 @@
               for (int i = 0; i < rules.size(); i++) {
                   try {
                       Rule rule = (Rule) rules.get(i);
  -                    if (debug >= 4)
  -                        log("  Fire begin() for " + rule);
  +                    if (debug) {
  +                        log.debug("  Fire begin() for " + rule);
  +                    }
                       rule.begin(list);
                   } catch (Exception e) {
  -                    log("Begin event threw exception", e);
  +                    log.error("Begin event threw exception", e);
                       throw createSAXException(e);
                   } catch (Throwable t) {
  -                    log("Begin event threw exception", t);
  +                    log.error("Begin event threw exception", t);
                       throw createSAXException(t.getMessage());
                   }
               }
           } else {
  -            if (debug >= 3)
  -                log("  No rules found matching '" + match + "'.");
  +            if (info) {
  +                log.info("  No rules found matching '" + match + "'.");
  +            }
           }
   
       }
  @@ -986,8 +979,9 @@
       public void startPrefixMapping(String prefix, String namespaceURI)
               throws SAXException {
   
  -        if (debug >= 3)
  -            log("startPrefixMapping(" + prefix + "," + namespaceURI + ")");
  +        if (log.isInfoEnabled()) {
  +            log.info("startPrefixMapping(" + prefix + "," + namespaceURI + ")");
  +        }
   
           // Register this prefix mapping
           ArrayStack stack = (ArrayStack) namespaces.get(prefix);
  @@ -1012,9 +1006,10 @@
        */
       public void notationDecl(String name, String publicId, String systemId) {
   
  -        if (debug >= 3)
  -            log("notationDecl(" + name + "," + publicId + "," +
  +        if (log.isInfoEnabled()) {
  +            log.info("notationDecl(" + name + "," + publicId + "," +
                       systemId + ")");
  +        }
   
       }
   
  @@ -1030,9 +1025,10 @@
       public void unparsedEntityDecl(String name, String publicId,
                                      String systemId, String notation) {
   
  -        if (debug >= 3)
  -            log("unparsedEntityDecl(" + name + "," + publicId + "," +
  +        if (log.isInfoEnabled()) {
  +            log.info("unparsedEntityDecl(" + name + "," + publicId + "," +
                       systemId + "," + notation + ")");
  +        }
   
       }
   
  @@ -1051,8 +1047,7 @@
       public InputSource resolveEntity(String publicId, String systemId)
               throws SAXException {
   
  -        if (debug >= 1)
  -            log("resolveEntity('" + publicId + "', '" + systemId + "')");
  +        log.info("resolveEntity('" + publicId + "', '" + systemId + "')");
           this.publicId = publicId;
   
           // Has this system identifier been registered?
  @@ -1060,14 +1055,12 @@
           if (publicId != null)
               dtdURL = (String) dtds.get(publicId);
           if (dtdURL == null) {
  -            if (debug >= 1)
  -                log(" Not registered, use system identifier");
  +            log.info(" Not registered, use system identifier");
               return (null);
           }
   
           // Return an input source to our alternative URL
  -        if (debug >= 1)
  -            log(" Resolving to alternate DTD '" + dtdURL + "'");
  +        log.info(" Resolving to alternate DTD '" + dtdURL + "'");
           try {
               URL url = new URL(dtdURL);
               InputStream stream = url.openStream();
  @@ -1092,7 +1085,7 @@
        */
       public void error(SAXParseException exception) throws SAXException {
   
  -        log("Parse Error at line " + exception.getLineNumber() +
  +        log.error("Parse Error at line " + exception.getLineNumber() +
                   " column " + exception.getColumnNumber() + ": " +
                   exception.getMessage(), exception);
           if (errorHandler != null)
  @@ -1111,7 +1104,7 @@
        */
       public void fatalError(SAXParseException exception) throws SAXException {
   
  -        log("Parse Fatal Error at line " + exception.getLineNumber() +
  +        log.error("Parse Fatal Error at line " + exception.getLineNumber() +
                   " column " + exception.getColumnNumber() + ": " +
                   exception.getMessage(), exception);
           if (errorHandler != null)
  @@ -1130,7 +1123,7 @@
        */
       public void warning(SAXParseException exception) throws SAXException {
   
  -        log("Parse Warning at line " + exception.getLineNumber() +
  +        log.error("Parse Warning at line " + exception.getLineNumber() +
                   " column " + exception.getColumnNumber() + ": " +
                   exception.getMessage(), exception);
           if (errorHandler != null)
  @@ -1139,44 +1132,6 @@
       }
   
   
  -    // ------------------------------------------------------ Logging Methods
  -
  -
  -    /**
  -     * Log a message to the log writer associated with this context.
  -     *
  -     * @param message The message to be logged
  -     */
  -    public void log(String message) {
  -
  -        if (writer == null)
  -            System.out.println(message);
  -        else
  -            writer.println(message);
  -
  -    }
  -
  -
  -    /**
  -     * Log a message and associated exception to the log writer
  -     * associated with this context.
  -     *
  -     * @param message The message to be logged
  -     * @param exception The associated exception to be logged
  -     */
  -    public void log(String message, Throwable exception) {
  -
  -        if (writer == null) {
  -            System.out.println(message);
  -            exception.printStackTrace(System.out);
  -        } else {
  -            writer.println(message);
  -            exception.printStackTrace(writer);
  -        }
  -
  -    }
  -
  -
       // ------------------------------------------------------- Public Methods
   
   
  @@ -1279,8 +1234,7 @@
        */
       public void register(String publicId, String dtdURL) {
   
  -        if (debug >= 1)
  -            log("register('" + publicId + "', '" + dtdURL + "'");
  +        log.info("register('" + publicId + "', '" + dtdURL + "'");
           dtds.put(publicId, dtdURL);
   
       }
  @@ -1311,11 +1265,11 @@
   
           String oldNamespaceURI = getRuleNamespaceURI();
           String newNamespaceURI = ruleSet.getNamespaceURI();
  -        if (debug >= 3) {
  +        if (log.isDebugEnabled()) {
               if (newNamespaceURI == null)
  -                log("addRuleSet() with no namespace URI");
  +                log.debug("addRuleSet() with no namespace URI");
               else
  -                log("addRuleSet() with namespace URI " + newNamespaceURI);
  +                log.debug("addRuleSet() with namespace URI " + newNamespaceURI);
           }
           setRuleNamespaceURI(newNamespaceURI);
           ruleSet.addRuleInstances(this);
  @@ -1708,8 +1662,7 @@
           try {
               return (stack.peek());
           } catch (EmptyStackException e) {
  -            if (debug >= 1)
  -                log("Empty stack (returning null)");
  +            log.info("Empty stack (returning null)");
               return (null);
           }
   
  @@ -1729,8 +1682,7 @@
           try {
               return (stack.peek(n));
           } catch (EmptyStackException e) {
  -            if (debug >= 1)
  -                log("Empty stack (returning null)");
  +            log.info("Empty stack (returning null)");
               return (null);
           }
   
  @@ -1746,8 +1698,7 @@
           try {
               return (stack.pop());
           } catch (EmptyStackException e) {
  -            if (debug >= 1)
  -                log("Empty stack (returning null)");
  +            log.info("Empty stack (returning null)");
               return (null);
           }
   
  @@ -1903,7 +1854,7 @@
                   return new SAXParseException(error, locator);
               }
           }
  -        System.out.println("No Locator!");
  +        log.error("No Locator!");
           if (e != null) {
               return new SAXException(message, e);
           } else {
  
  
  
  1.6       +7 -7      jakarta-commons/digester/src/java/org/apache/commons/digester/FactoryCreateRule.java
  
  Index: FactoryCreateRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/FactoryCreateRule.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FactoryCreateRule.java	4 Jan 2002 02:34:08 -0000	1.5
  +++ FactoryCreateRule.java	4 Jan 2002 05:32:11 -0000	1.6
  @@ -73,7 +73,7 @@
    * in a call to either a factory method or to a non-empty constructor.
    *
    * @author Robert Burrell Donkin
  - * @version $Revision: 1.5 $ $Date: 2002/01/04 02:34:08 $
  + * @version $Revision: 1.6 $ $Date: 2002/01/04 05:32:11 $
    */
   
   public class FactoryCreateRule extends Rule {
  @@ -203,8 +203,8 @@
       public void begin(Attributes attributes) throws Exception {
   
           Object instance = getFactory(attributes).createObject(attributes);
  -        if (digester.getDebug() >= 1)
  -            digester.log("New " + instance.getClass().getName());
  +        if (digester.log.isDebugEnabled())
  +            digester.log.debug("New " + instance.getClass().getName());
           digester.push(instance);
   
       }
  @@ -216,8 +216,8 @@
       public void end() throws Exception {
   
           Object top = digester.pop();
  -        if (digester.getDebug() >= 1)
  -            digester.log("Pop " + top.getClass().getName());
  +        if (digester.log.isDebugEnabled())
  +            digester.log.debug("Pop " + top.getClass().getName());
   
       }
   
  @@ -274,8 +274,8 @@
                   if (value != null)
                       realClassName = value;
               }
  -            if (digester.getDebug() >= 1)
  -                digester.log("New factory " + realClassName);
  +            if (digester.log.isDebugEnabled())
  +                digester.log.debug("New factory " + realClassName);
               Class clazz = digester.getClassLoader().loadClass(realClassName);
               creationFactory = (ObjectCreationFactory)
                       clazz.newInstance();
  
  
  
  1.8       +8 -8      jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java
  
  Index: ObjectCreateRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ObjectCreateRule.java	4 Jan 2002 02:34:08 -0000	1.7
  +++ ObjectCreateRule.java	4 Jan 2002 05:32:11 -0000	1.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java,v 1.7 2002/01/04 02:34:08 sanders Exp $
  - * $Revision: 1.7 $
  - * $Date: 2002/01/04 02:34:08 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/ObjectCreateRule.java,v 1.8 2002/01/04 05:32:11 sanders Exp $
  + * $Revision: 1.8 $
  + * $Date: 2002/01/04 05:32:11 $
    *
    * ====================================================================
    *
  @@ -73,7 +73,7 @@
    *
    * @author Craig McClanahan
    * @author Scott Sanders
  - * @version $Revision: 1.7 $ $Date: 2002/01/04 02:34:08 $
  + * @version $Revision: 1.8 $ $Date: 2002/01/04 05:32:11 $
    */
   
   public class ObjectCreateRule extends Rule {
  @@ -176,8 +176,8 @@
               if (value != null)
                   realClassName = value;
           }
  -        if (digester.getDebug() >= 1)
  -            digester.log("New " + realClassName);
  +        if (digester.log.isDebugEnabled())
  +            digester.log.debug("New " + realClassName);
   
           // Instantiate the new object and push it on the context stack
           Class clazz = digester.getClassLoader().loadClass(realClassName);
  @@ -193,8 +193,8 @@
       public void end() throws Exception {
   
           Object top = digester.pop();
  -        if (digester.getDebug() >= 1)
  -            digester.log("Pop " + top.getClass().getName());
  +        if (digester.log.isDebugEnabled())
  +            digester.log.debug("Pop " + top.getClass().getName());
   
       }
   
  
  
  
  1.9       +7 -7      jakarta-commons/digester/src/java/org/apache/commons/digester/SetNextRule.java
  
  Index: SetNextRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetNextRule.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SetNextRule.java	15 Dec 2001 19:45:56 -0000	1.8
  +++ SetNextRule.java	4 Jan 2002 05:32:11 -0000	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetNextRule.java,v 1.8 2001/12/15 19:45:56 craigmcc Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/12/15 19:45:56 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetNextRule.java,v 1.9 2002/01/04 05:32:11 sanders Exp $
  + * $Revision: 1.9 $
  + * $Date: 2002/01/04 05:32:11 $
    *
    * ====================================================================
    *
  @@ -76,7 +76,7 @@
    *
    * @author Craig McClanahan
    * @author Scott Sanders
  - * @version $Revision: 1.8 $ $Date: 2001/12/15 19:45:56 $
  + * @version $Revision: 1.9 $ $Date: 2002/01/04 05:32:11 $
    */
   
   public class SetNextRule extends Rule {
  @@ -146,12 +146,12 @@
   	// Identify the objects to be used
   	Object child = digester.peek(0);
   	Object parent = digester.peek(1);
  -	if (digester.getDebug() >= 1) {
  +	if (digester.log.isDebugEnabled()) {
               if (parent == null)
  -                digester.log("Call [NULL PARENT]." +
  +                digester.log.debug("Call [NULL PARENT]." +
                                methodName + "(" + child + ")");
               else
  -                digester.log("Call " + parent.getClass().getName() + "." +
  +                digester.log.debug("Call " + parent.getClass().getName() + "." +
                                methodName + "(" + child + ")");
           }
   
  
  
  
  1.5       +8 -8      jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertiesRule.java
  
  Index: SetPropertiesRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertiesRule.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SetPropertiesRule.java	20 Aug 2001 18:28:40 -0000	1.4
  +++ SetPropertiesRule.java	4 Jan 2002 05:32:11 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertiesRule.java,v 1.4 2001/08/20 18:28:40 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2001/08/20 18:28:40 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertiesRule.java,v 1.5 2002/01/04 05:32:11 sanders Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/01/04 05:32:11 $
    *
    * ====================================================================
    *
  @@ -73,7 +73,7 @@
    * stack, based on attributes with corresponding names.
    *
    * @author Craig McClanahan
  - * @version $Revision: 1.4 $ $Date: 2001/08/20 18:28:40 $
  + * @version $Revision: 1.5 $ $Date: 2002/01/04 05:32:11 $
    */
   
   public class SetPropertiesRule extends Rule {
  @@ -112,16 +112,16 @@
               if ("".equals(name))
                   name = attributes.getQName(i);
   	    String value = attributes.getValue(i);
  -            if (digester.getDebug() >= 9)
  -                digester.log("  Setting property '" + name + "' to '" +
  +            if (digester.log.isDebugEnabled())
  +                digester.log.debug("  Setting property '" + name + "' to '" +
                                value + "'");
   	    values.put(name, value);
   	}
   
   	// Populate the corresponding properties of the top object
   	Object top = digester.peek();
  -	if (digester.getDebug() >= 1)
  -	    digester.log("Set " + top.getClass().getName() + " properties");
  +	if (digester.log.isDebugEnabled())
  +	    digester.log.debug("Set " + top.getClass().getName() + " properties");
   	BeanUtils.populate(top, values);
   
   
  
  
  
  1.5       +6 -6      jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertyRule.java
  
  Index: SetPropertyRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertyRule.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SetPropertyRule.java	20 Aug 2001 18:28:40 -0000	1.4
  +++ SetPropertyRule.java	4 Jan 2002 05:32:11 -0000	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertyRule.java,v 1.4 2001/08/20 18:28:40 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2001/08/20 18:28:40 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetPropertyRule.java,v 1.5 2002/01/04 05:32:11 sanders Exp $
  + * $Revision: 1.5 $
  + * $Date: 2002/01/04 05:32:11 $
    *
    * ====================================================================
    *
  @@ -73,7 +73,7 @@
    * top of the stack, based on attributes with specified names.
    *
    * @author Craig McClanahan
  - * @version $Revision: 1.4 $ $Date: 2001/08/20 18:28:40 $
  + * @version $Revision: 1.5 $ $Date: 2002/01/04 05:32:11 $
    */
   
   public class SetPropertyRule extends Rule {
  @@ -145,8 +145,8 @@
   
   	// Populate the corresponding property of the top object
   	Object top = digester.peek();
  -	if (digester.getDebug() >= 1)
  -	    digester.log("Set " + top.getClass().getName() + " property " +
  +	if (digester.log.isDebugEnabled())
  +	    digester.log.debug("Set " + top.getClass().getName() + " property " +
   			 actualName + " to " + actualValue);
   	BeanUtils.populate(top, values);
   
  
  
  
  1.9       +7 -7      jakarta-commons/digester/src/java/org/apache/commons/digester/SetTopRule.java
  
  Index: SetTopRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetTopRule.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SetTopRule.java	15 Dec 2001 19:45:56 -0000	1.8
  +++ SetTopRule.java	4 Jan 2002 05:32:11 -0000	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetTopRule.java,v 1.8 2001/12/15 19:45:56 craigmcc Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/12/15 19:45:56 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/SetTopRule.java,v 1.9 2002/01/04 05:32:11 sanders Exp $
  + * $Revision: 1.9 $
  + * $Date: 2002/01/04 05:32:11 $
    *
    * ====================================================================
    *
  @@ -75,7 +75,7 @@
    *
    * @author Craig McClanahan
    * @author Scott Sanders
  - * @version $Revision: 1.8 $ $Date: 2001/12/15 19:45:56 $
  + * @version $Revision: 1.9 $ $Date: 2002/01/04 05:32:11 $
    */
   
   public class SetTopRule extends Rule {
  @@ -145,12 +145,12 @@
   	// Identify the objects to be used
   	Object child = digester.peek(1);
   	Object parent = digester.peek(0);
  -	if (digester.getDebug() >= 1) {
  +	if (digester.log.isDebugEnabled()) {
               if (parent == null)
  -                digester.log("Call [NULL PARENT]." +
  +                digester.log.debug("Call [NULL PARENT]." +
                                methodName + "(" + child + ")");
               else
  -                digester.log("Call " + parent.getClass().getName() + "." +
  +                digester.log.debug("Call " + parent.getClass().getName() + "." +
                                methodName + "(" + child + ")");
           }
   
  
  
  
  1.2       +5 -4      jakarta-commons/digester/src/java/org/apache/commons/digester/rss/RSSDigester.java
  
  Index: RSSDigester.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/rss/RSSDigester.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RSSDigester.java	22 May 2001 02:55:03 -0000	1.1
  +++ RSSDigester.java	4 Jan 2002 05:32:11 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/rss/RSSDigester.java,v 1.1 2001/05/22 02:55:03 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/05/22 02:55:03 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/rss/RSSDigester.java,v 1.2 2002/01/04 05:32:11 sanders Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/01/04 05:32:11 $
    *
    * ====================================================================
    *
  @@ -68,6 +68,7 @@
   import java.io.InputStream;
   import java.net.URL;
   import org.apache.commons.digester.Digester;
  +import org.apache.commons.logging.LogSource;
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
   
  @@ -86,7 +87,7 @@
    * example of using these classes.</p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2001/05/22 02:55:03 $
  + * @version $Revision: 1.2 $ $Date: 2002/01/04 05:32:11 $
    */
   
   public class RSSDigester extends Digester {
  @@ -351,7 +352,7 @@
               System.out.println("Creating new digester ...");
               RSSDigester digester = new RSSDigester();
               if ((args.length > 0) && (args[0].equals("-debug")))
  -                digester.setDebug(999);
  +                digester.setLogger(LogSource.getInstance("RSSDigester"));
               System.out.println("Parsing input stream ...");
               Channel channel = (Channel) digester.parse(is);
               System.out.println("Closing input stream ...");
  
  
  
  1.2       +11 -25    jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.java
  
  Index: DigesterRuleParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DigesterRuleParser.java	4 Dec 2001 19:51:22 -0000	1.1
  +++ DigesterRuleParser.java	4 Jan 2002 05:32:11 -0000	1.2
  @@ -67,18 +67,7 @@
   import java.util.List;
   import java.util.Set;
   import org.apache.commons.collections.ArrayStack;
  -import org.apache.commons.digester.AbstractObjectCreationFactory;
  -import org.apache.commons.digester.CallMethodRule;
  -import org.apache.commons.digester.FactoryCreateRule;
  -import org.apache.commons.digester.ObjectCreateRule;
  -import org.apache.commons.digester.Rule;
  -import org.apache.commons.digester.Rules;
  -import org.apache.commons.digester.RuleSetBase;
  -import org.apache.commons.digester.SetNextRule;
  -import org.apache.commons.digester.SetPropertiesRule;
  -import org.apache.commons.digester.SetPropertiesRule;
  -import org.apache.commons.digester.SetPropertyRule;
  -import org.apache.commons.digester.SetTopRule;
  +import org.apache.commons.digester.*;
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXException;
   
  @@ -104,7 +93,7 @@
        * This is the digester to which we are adding the rules that we parse
        * from the Rules XML document.
        */    
  -    protected org.apache.commons.digester.Digester targetDigester;
  +    protected Digester targetDigester;
   
   
       /**
  @@ -153,7 +142,7 @@
        * into Rule objects, and adding them to the given Digester
        * @param targetDigester the Digester to add the rules to
        */
  -    public DigesterRuleParser(org.apache.commons.digester.Digester targetDigester) {
  +    public DigesterRuleParser(Digester targetDigester) {
           this.targetDigester = targetDigester;
           patternStack = new PatternStack();
       }
  @@ -168,7 +157,7 @@
        * @param stack Stack containing the prefix pattern string to be prepended
        * to any pattern parsed by this rule set.
        */
  -    private DigesterRuleParser(org.apache.commons.digester.Digester targetDigester, 
  +    private DigesterRuleParser(Digester targetDigester,
           PatternStack stack, Set includedFiles) {
           this.targetDigester = targetDigester;
           patternStack = stack;
  @@ -179,7 +168,7 @@
        * Sets the digester into which to add the parsed rules
        * @param d the Digester to add the rules to
        */
  -    public void setTarget(org.apache.commons.digester.Digester d) {
  +    public void setTarget(Digester d) {
           targetDigester = d;
       }
       
  @@ -223,7 +212,7 @@
        * should of this method should call this implementation first: i.e. 
        * <code>super.addRuleInstances(digester);</code>
        */
  -    public void addRuleInstances(org.apache.commons.digester.Digester digester) {
  +    public void addRuleInstances(Digester digester) {
           final String ruleClassName = Rule.class.getName();
           digester.register(DIGESTER_PUBLIC_ID, getDigesterRulesDTD());
           
  @@ -279,7 +268,7 @@
            * @param digester the Digester used to parse the rules XML file
            * @param attrName The name of the attribute containing the pattern
            */
  -        public PatternRule(org.apache.commons.digester.Digester digester, String attrName) {
  +        public PatternRule(Digester digester, String attrName) {
               super(digester);
               this.attrName = attrName;
           }
  @@ -316,7 +305,7 @@
        * the parse.
        */
       private class IncludeRule extends Rule {
  -        public IncludeRule(org.apache.commons.digester.Digester digester) {
  +        public IncludeRule(Digester digester) {
               super(digester);
           }
           
  @@ -361,10 +350,7 @@
               DigesterRuleParser includedSet =
                       new DigesterRuleParser(targetDigester, patternStack, includedFiles);
               includedSet.setDigesterRulesDTD(getDigesterRulesDTD());
  -            org.apache.commons.digester.Digester digester = new org.apache.commons.digester.Digester();
  -            // Keeps digester from outputting stack trace to stdout, if a
  -            // CircularIncludeException is raised
  -            digester.setWriter(new PrintWriter(new NullLogWriter(digester)));
  +            Digester digester = new Digester();
               digester.addRuleSet(includedSet);
               digester.push(DigesterRuleParser.this);
               digester.parse(fileName);
  @@ -442,7 +428,7 @@
           /**
            * This method passes through to the underlying Rules object.
            */
  -        public org.apache.commons.digester.Digester getDigester() {
  +        public Digester getDigester() {
               return delegate.getDigester();
           }
           
  @@ -477,7 +463,7 @@
           /**
            * This method passes through to the underlying Rules object.
            */
  -        public void setDigester(org.apache.commons.digester.Digester digester) {
  +        public void setDigester(Digester digester) {
               delegate.setDigester(digester);
           }
           
  
  
  
  1.2       +1 -7      jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/FromXmlRuleSet.java
  
  Index: FromXmlRuleSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/FromXmlRuleSet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FromXmlRuleSet.java	4 Dec 2001 19:50:44 -0000	1.1
  +++ FromXmlRuleSet.java	4 Jan 2002 05:32:11 -0000	1.2
  @@ -129,15 +129,9 @@
           parser.setTarget(digester);
           
           Digester rulesDigester = new Digester();
  -        
  -        rulesDigester.setDebug(0);
  -        
  -        // fix the rules digester's logging behavior. If debug==0, logs nothing
  -        // not even exception stack traces. If debug>0, log messages go to stderr.
  -        rulesDigester.setWriter(new PrintWriter(new NullLogWriter(rulesDigester)));
           rulesDigester.addRuleSet(parser);
  -
           rulesDigester.push(parser);
  +
           try {
               rulesDigester.parse(xmlRules.openStream());
           } catch (Exception ex) {
  
  
  
  1.6       +4 -35     jakarta-commons/digester/src/test/org/apache/commons/digester/DigesterTestCase.java
  
  Index: DigesterTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/test/org/apache/commons/digester/DigesterTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DigesterTestCase.java	4 Dec 2001 19:47:00 -0000	1.5
  +++ DigesterTestCase.java	4 Jan 2002 05:32:11 -0000	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/digester/src/test/org/apache/commons/digester/DigesterTestCase.java,v 1.5 2001/12/04 19:47:00 sanders Exp $
  - * $Revision: 1.5 $
  - * $Date: 2001/12/04 19:47:00 $
  + * $Header: /home/cvs/jakarta-commons/digester/src/test/org/apache/commons/digester/DigesterTestCase.java,v 1.6 2002/01/04 05:32:11 sanders Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/01/04 05:32:11 $
    *
    * ====================================================================
    *
  @@ -83,7 +83,7 @@
    * </p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.5 $ $Date: 2001/12/04 19:47:00 $
  + * @version $Revision: 1.6 $ $Date: 2002/01/04 05:32:11 $
    */
   
   public class DigesterTestCase extends TestCase {
  @@ -165,40 +165,9 @@
   
   
       /**
  -     * Test the ability to redirect logging to an alternate destination.
  -     */
  -    public void testLogging() {
  -
  -        assertNull("Initial writer is null", digester.getWriter());
  -
  -        StringWriter sw = new StringWriter();
  -        PrintWriter pw = new PrintWriter(sw);
  -        digester.setWriter(pw);
  -        digester.log("This is line 1");
  -        digester.log("And this is line 2");
  -        String value = "This is line 1" +
  -            System.getProperty("line.separator") +
  -            "And this is line 2" +
  -            System.getProperty("line.separator");
  -        pw.flush();
  -        assertEquals("Logged output identical", value, sw.toString());
  -
  -        digester.setWriter(null);
  -        assertNull("Reset writer is null", digester.getWriter());
  -
  -    }
  -
  -
  -    /**
        * Test the basic property getters and setters.
        */
       public void testProperties() {
  -
  -        assertEquals("Initial debug is zero", 0, digester.getDebug());
  -        digester.setDebug(1);
  -        assertEquals("Set debug is one", 1, digester.getDebug());
  -        digester.setDebug(0);
  -        assertEquals("Reset debug is zero", 0, digester.getDebug());
   
           assertNull("Initial error handler is null",
                      digester.getErrorHandler());
  
  
  
  1.2       +0 -1      jakarta-commons/digester/src/test/org/apache/commons/digester/xmlrules/DigesterLoaderTest.java
  
  Index: DigesterLoaderTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/test/org/apache/commons/digester/xmlrules/DigesterLoaderTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DigesterLoaderTest.java	4 Dec 2001 19:48:47 -0000	1.1
  +++ DigesterLoaderTest.java	4 Jan 2002 05:32:11 -0000	1.2
  @@ -103,7 +103,6 @@
           assertNotNull("The test could not locate test.xml", input);
           Digester digester = DigesterLoader.createDigester(rules);
           digester.push(new ArrayList());
  -        digester.setDebug(0);
           Object root = digester.parse(input.openStream());
           assertEquals(root.toString(), "[foo1 baz1 foo2, foo3 foo4]");
           //System.out.println(root);
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message