commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules DigesterRuleParser.java
Date Sun, 15 Feb 2004 01:02:14 GMT
craigmcc    2004/02/14 17:02:14

  Modified:    digester PROPOSAL.html STATUS.html build.properties.sample
                        build.xml
               digester/src/java/org/apache/commons/digester
                        CallParamRule.java Digester.java
                        FactoryCreateRule.java Substitutor.java
               digester/src/java/org/apache/commons/digester/parser
                        XercesParser.java
               digester/src/java/org/apache/commons/digester/substitution
                        VariableSubstitutor.java
               digester/src/java/org/apache/commons/digester/xmlrules
                        DigesterRuleParser.java
  Added:       digester/src/java/org/apache/commons/digester
                        ArrayStack.java
  Log:
  As agreed to earlier on the COMMONS-DEV mailing list, remove direct
  dependence on commons-collections.  This involves maintaining a local
  copy of ArrayStack that was originally contributed to Collections when
  Digester and Beanutils were factored out of Struts.
  
  There is still a runtime dependency on commons-collections by virtue of
  the fact that commons-beanutils requires it.  Once this dependency is
  lifted, we can remove commons-collections settings from the build.xml and
  build.properties.sample files, as well as from the unit test classpath.
  
  Also fixed a couple of Javadoc errors that triggered warning messages.
  
  Revision  Changes    Path
  1.2       +1 -1      jakarta-commons/digester/PROPOSAL.html
  
  Index: PROPOSAL.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/PROPOSAL.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PROPOSAL.html	3 May 2001 00:28:32 -0000	1.1
  +++ PROPOSAL.html	15 Feb 2004 01:02:13 -0000	1.2
  @@ -39,7 +39,7 @@
     <li>A JAXP 1.1 implementation</li>
     <li>A SAX 2.0 parser conforming to the JAXP 1.1 APIs</li>
     <li>BeanUtils from Commons - for instrospection information</li>
  -  <li>Collections from Commons - for ArrayStack</li>
  +  <li>Collections from Commons - inherited dependence from BeanUtils</li>
   </ul>
   
   <h3>(2) Initial Source of the Package</h3>
  
  
  
  1.11      +4 -2      jakarta-commons/digester/STATUS.html
  
  Index: STATUS.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/STATUS.html,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- STATUS.html	27 Apr 2003 18:53:15 -0000	1.10
  +++ STATUS.html	15 Feb 2004 01:02:13 -0000	1.11
  @@ -53,7 +53,9 @@
       <li><a href="http://xml.apache.org/xerces-j">Xerces</a> (Version
1.3.1 or later)</li>
       </ul></li>
   <li><a href="http://jakarta.apache.org/jakarta-commons/beanutils/">Jakarta
Commons BeanUtils</a></li>
  -<li><a href="http://jakarta.apache.org/jakarta-commons/collections/">Jakarta
Commons Collections</a></li>
  +<li><a href="http://jakarta.apache.org/jakarta-commons/collections/">Jakarta
  +    Commons Collections</a> (this is a runtime inheritance only, inherited
  +    from Jakarta Commons BeanUtls)</li>
   </ul>
   
   
  
  
  
  1.8       +3 -1      jakarta-commons/digester/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/build.properties.sample,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- build.properties.sample	10 Jan 2004 15:43:06 -0000	1.7
  +++ build.properties.sample	15 Feb 2004 01:02:13 -0000	1.8
  @@ -4,7 +4,9 @@
   jaxp.parser.jar=${jaxp.home}/crimson.jar
   
   # Commons projects -- correct if 'ant dist' is run on each project in the
  -# default CVS directory layout
  +# default CVS directory layout.  Note that Digester no longer depends on
  +# commons-collections itself; there is a runtime dependency currently
  +# inherited from commons-beanutils, however.
   commons-beanutils.home=../beanutils/dist
   commons-beanutils.jar=${commons-beanutils.home}/commons-beanutils.jar
   commons-collections.home=../collections/dist
  
  
  
  1.51      +1 -2      jakarta-commons/digester/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/build.xml,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- build.xml	2 Dec 2003 23:21:16 -0000	1.50
  +++ build.xml	15 Feb 2004 01:02:13 -0000	1.51
  @@ -91,7 +91,6 @@
       <pathelement location="${jaxp.jaxp.jar}"/>
       <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>
  
  
  
  1.18      +4 -6      jakarta-commons/digester/src/java/org/apache/commons/digester/CallParamRule.java
  
  Index: CallParamRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/CallParamRule.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- CallParamRule.java	10 Jan 2004 17:32:29 -0000	1.17
  +++ CallParamRule.java	15 Feb 2004 01:02:13 -0000	1.18
  @@ -65,8 +65,6 @@
   
   import org.xml.sax.Attributes;
   
  -import org.apache.commons.collections.ArrayStack;
  -
   
   /**
    * <p>Rule implementation that saves a parameter for use by a surrounding 
  
  
  
  1.92      +4 -5      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.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- Digester.java	24 Jan 2004 11:22:31 -0000	1.91
  +++ Digester.java	15 Feb 2004 01:02:13 -0000	1.92
  @@ -80,7 +80,6 @@
   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.LogFactory;
   import org.xml.sax.Attributes;
  
  
  
  1.18      +4 -5      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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- FactoryCreateRule.java	10 Jan 2004 17:34:18 -0000	1.17
  +++ FactoryCreateRule.java	15 Feb 2004 01:02:13 -0000	1.18
  @@ -62,7 +62,6 @@
   
   package org.apache.commons.digester;
   
  -import org.apache.commons.collections.ArrayStack;
   import org.xml.sax.Attributes;
   
   
  
  
  
  1.5       +6 -6      jakarta-commons/digester/src/java/org/apache/commons/digester/Substitutor.java
  
  Index: Substitutor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/Substitutor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Substitutor.java	10 Jan 2004 17:51:57 -0000	1.4
  +++ Substitutor.java	15 Feb 2004 01:02:13 -0000	1.5
  @@ -104,8 +104,8 @@
        * This method may substitute values into the body text of the
        * elements that Digester parses.
        *
  -     * @param the body text (as passed to <code>Digester</code>)
  +     * @param bodyText the body text (as passed to <code>Digester</code>)
        * @return the body text to be passed to the <code>Rule</code> implementations
        */
       public abstract String substitute(String bodyText);
  -}
  \ No newline at end of file
  +}
  
  
  
  1.1                  jakarta-commons/digester/src/java/org/apache/commons/digester/ArrayStack.java
  
  Index: ArrayStack.java
  ===================================================================
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2004 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowledgement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgement may appear in the software itself,
   *    if and wherever such third-party acknowledgements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.commons.digester;
  
  import java.util.ArrayList;
  import java.util.EmptyStackException;
  
  /**
   * <p>Imported copy of the <code>ArrayStack</code> class from
   * Commons Collections, which was the only direct dependency from Digester.</p>
   *
   * <p><strong>WARNNG</strong> - This class is public solely to allow it
to be
   * used from the <code>org.apache.commons.digester.xmlrules</code> package.
   * It should not be considered part of the public API of Commons Digester.
   * If you want to use such a class yourself, you should use the one from
   * Commons Collections directly.</p>
   *
   * <p>An implementation of the {@link java.util.Stack} API that is based on an
   * <code>ArrayList</code> instead of a <code>Vector</code>, so it
is not
   * synchronized to protect against multi-threaded access.  The implementation
   * is therefore operates faster in environments where you do not need to
   * worry about multiple thread contention.</p>
   *
   * <p>Unlike <code>Stack</code>, <code>ArrayStack</code> accepts
null entries.
   * </p>
   *
   * @see java.util.Stack
   * @since Commons Collections 1.0
   * @version $Revision: 1.1 $ $Date: 2004/02/15 01:02:13 $
   * 
   * @author Craig R. McClanahan
   * @author Paul Jack
   * @author Stephen Colebourne
   */
  public class ArrayStack extends ArrayList {
  
      /** Ensure serialization compatibility */    
      private static final long serialVersionUID = 2130079159931574599L;
  
      /**
       * Constructs a new empty <code>ArrayStack</code>. The initial size
       * is controlled by <code>ArrayList</code> and is currently 10.
       */
      public ArrayStack() {
          super();
      }
  
      /**
       * Constructs a new empty <code>ArrayStack</code> with an initial size.
       * 
       * @param initialSize  the initial size to use
       * @throws IllegalArgumentException  if the specified initial size
       *  is negative
       */
      public ArrayStack(int initialSize) {
          super(initialSize);
      }
  
      /**
       * Return <code>true</code> if this stack is currently empty.
       * <p>
       * This method exists for compatibility with <code>java.util.Stack</code>.
       * New users of this class should use <code>isEmpty</code> instead.
       * 
       * @return true if the stack is currently empty
       */
      public boolean empty() {
          return isEmpty();
      }
  
      /**
       * Returns the top item off of this stack without removing it.
       *
       * @return the top item on the stack
       * @throws EmptyStackException  if the stack is empty
       */
      public Object peek() throws EmptyStackException {
          int n = size();
          if (n <= 0) {
              throw new EmptyStackException();
          } else {
              return get(n - 1);
          }
      }
  
      /**
       * Returns the n'th item down (zero-relative) from the top of this
       * stack without removing it.
       *
       * @param n  the number of items down to go
       * @return the n'th item on the stack, zero relative
       * @throws EmptyStackException  if there are not enough items on the
       *  stack to satisfy this request
       */
      public Object peek(int n) throws EmptyStackException {
          int m = (size() - n) - 1;
          if (m < 0) {
              throw new EmptyStackException();
          } else {
              return get(m);
          }
      }
  
      /**
       * Pops the top item off of this stack and return it.
       *
       * @return the top item on the stack
       * @throws EmptyStackException  if the stack is empty
       */
      public Object pop() throws EmptyStackException {
          int n = size();
          if (n <= 0) {
              throw new EmptyStackException();
          } else {
              return remove(n - 1);
          }
      }
  
      /**
       * Pushes a new item onto the top of this stack. The pushed item is also
       * returned. This is equivalent to calling <code>add</code>.
       *
       * @param item  the item to be added
       * @return the item just pushed
       */
      public Object push(Object item) {
          add(item);
          return item;
      }
  
  
      /**
       * Returns the one-based position of the distance from the top that the
       * specified object exists on this stack, where the top-most element is
       * considered to be at distance <code>1</code>.  If the object is not
       * present on the stack, return <code>-1</code> instead.  The
       * <code>equals()</code> method is used to compare to the items
       * in this stack.
       *
       * @param object  the object to be searched for
       * @return the 1-based depth into the stack of the object, or -1 if not found
       */
      public int search(Object object) {
          int i = size() - 1;        // Current index
          int n = 1;                 // Current distance
          while (i >= 0) {
              Object current = get(i);
              if ((object == null && current == null) ||
                  (object != null && object.equals(current))) {
                  return n;
              }
              i--;
              n++;
          }
          return -1;
      }
  
  
  }
  
  
  
  1.3       +2 -2      jakarta-commons/digester/src/java/org/apache/commons/digester/parser/XercesParser.java
  
  Index: XercesParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/parser/XercesParser.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XercesParser.java	10 Jan 2004 17:40:27 -0000	1.2
  +++ XercesParser.java	15 Feb 2004 01:02:14 -0000	1.3
  @@ -216,7 +216,7 @@
       /**
        * Configure schema validation as recommended by the Xerces spec. 
        * Both DTD and Schema validation will be enabled simultaneously.
  -     * @param properties parser optional info
  +     * @param factory SAXParserFactory to be configured
        */
       private static void configureXerces(SAXParserFactory factory)
               throws ParserConfigurationException, 
  @@ -227,4 +227,4 @@
           factory.setFeature(XERCES_SCHEMA, true);
   
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.4       +5 -5      jakarta-commons/digester/src/java/org/apache/commons/digester/substitution/VariableSubstitutor.java
  
  Index: VariableSubstitutor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/substitution/VariableSubstitutor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- VariableSubstitutor.java	10 Jan 2004 17:43:46 -0000	1.3
  +++ VariableSubstitutor.java	15 Feb 2004 01:02:14 -0000	1.4
  @@ -137,7 +137,7 @@
        * This method may substitute values into the body text of the
        * elements that Digester parses.
        *
  -     * @param the body text (as passed to <code>Digester</code>)
  +     * @param bodyText the body text (as passed to <code>Digester</code>)
        * @return the body text to be passed to the <code>Rule</code> implementations
        */
       public String substitute(String bodyText) {
  
  
  
  1.24      +4 -4      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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- DigesterRuleParser.java	10 Jan 2004 17:45:07 -0000	1.23
  +++ DigesterRuleParser.java	15 Feb 2004 01:02:14 -0000	1.24
  @@ -74,7 +74,7 @@
   
   import org.apache.commons.beanutils.ConvertUtils;
   
  -import org.apache.commons.collections.ArrayStack;
  +import org.apache.commons.digester.ArrayStack;
   
   import org.apache.commons.digester.AbstractObjectCreationFactory;
   import org.apache.commons.digester.BeanPropertySetterRule;
  
  
  

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


Mime
View raw message