[jdom-interest] collections

Michael Salmon ms at speakeasy.net
Mon May 20 15:08:52 PDT 2002


hi folks,
    there is a problem with build.xml for the collections target. the first
ten or so replacements are useless since there are no references (except in
samples/) to any of the tokens to be replaced, eg. Collection is used
instead of java.util.Collection. For this build.xml to work as designed
the classnames must be absolute. This was not noticed because I assume
the people building it and testing it were compiling with only java 1.1
apis in their CLASSPATH so the only thing that was doing the trick was
adding import com.sun.java.util.collections.* to the build CP. 
Since I think it is useful to be able to build jdom for 1.1 without running
1.1, attached is a patch to fix this. Basically it changes all refs to
a collection class to the full path java.util.$collectionClass. I added
one token replacement in build.xml also. Now you can build jdom for 1.1
for real. though you'd have to be a lunatic like myself to want to.

ms-
-------------- next part --------------
diff -u jdom.orig/AttributeList.java jdom/AttributeList.java
--- jdom.orig/AttributeList.java	Mon Apr 29 06:38:15 2002
+++ jdom/AttributeList.java	Tue May 21 01:51:31 2002
@@ -62,7 +62,7 @@
 
 /**
  * <code>AttributeList</code> represents legal JDOM <code>Attribute</code>
- * content.  This class is NOT PUBLIC; users should see it as a simple List
+ * content.  This class is NOT PUBLIC; users should see it as a simple  java.util.List
  * implementation.
  *
  * @author Alex Rosen
@@ -76,8 +76,8 @@
  * @see ProcessingInstruction
  * @see Text
  */
-class AttributeList extends AbstractList
-                    implements List, java.io.Serializable {
+class AttributeList extends  java.util.AbstractList
+                    implements  java.util.List, java.io.Serializable {
 
     private static final String CVS_ID =
       "@(#) $RCSfile: AttributeList.java,v $ $Revision: 1.13 $ $Date: 2002/04/29 13:38:15 $ $Name:  $";
@@ -206,7 +206,7 @@
      * @return <code>true</code> if the list was modified as a result of
      * the add.
      */
-    public boolean addAll(Collection collection) {
+    public boolean addAll( java.util.Collection collection) {
         return addAll(size(), collection);
     }
 
@@ -221,7 +221,7 @@
      *                           the add.
      * throws IndexOutOfBoundsException if index < 0 || index > size()
      */
-    public boolean addAll(int index, Collection collection) {
+    public boolean addAll(int index,  java.util.Collection collection) {
         if (index<0 || index>size) {
             throw new IndexOutOfBoundsException("Index: " + index +
                                                 " Size: " + size());
@@ -234,7 +234,7 @@
         int count = 0;
 
         try {
-            Iterator i = collection.iterator();
+             java.util.Iterator i = collection.iterator();
             while (i.hasNext()) {
                 Object obj = i.next();
                 add(index + count, obj);
@@ -267,12 +267,12 @@
 
     /**
      * Clear the current list and set it to the contents
-     * of the <code>Collection</code>.
+     * of the <code> java.util.Collection</code>.
      * object.
      *
      * @param collection The collection to use.
      */
-    public void clearAndSet(Collection collection) {
+    public void clearAndSet( java.util.Collection collection) {
         Attribute[] old = elementData;
         int oldSize = size;
 
@@ -412,7 +412,7 @@
     }
 
     /**
-     * Set the object at the specified location to the supplied
+     *  java.util.Set the object at the specified location to the supplied
      * object.
      *
      * @param index The location to set the value to.
@@ -440,7 +440,7 @@
     }
 
     /**
-     * Set the object at the specified location to the supplied
+     *  java.util.Set the object at the specified location to the supplied
      * object. Note: does not check for duplicate attributes.
      *
      * @param index The location to set the value to.
Only in jdom.orig: CVS
diff -u jdom.orig/ContentList.java jdom/ContentList.java
--- jdom.orig/ContentList.java	Mon Apr 29 06:38:15 2002
+++ jdom/ContentList.java	Tue May 21 02:00:46 2002
@@ -56,7 +56,6 @@
 
 package org.jdom;
 
-import java.util.*;
 import java.util.NoSuchElementException; // mysteriously helps JDK 1.1.x builds
 
 import org.jdom.filter.Filter;
@@ -64,7 +63,7 @@
 /**
  * <code>ContentList</code> represents legal JDOM content, including content
  * for <code>Document</code>s or <code>Element</code>s.
- * This class is NOT PUBLIC; users should see it as a simple List
+ * This class is NOT PUBLIC; users should see it as a simple  java.util.List
  * implementation.
  *
  * @author Alex Rosen
@@ -78,7 +77,7 @@
  * @see ProcessingInstruction
  * @see Text
  */
-class ContentList extends AbstractList implements java.io.Serializable {
+class ContentList extends  java.util.AbstractList implements java.io.Serializable {
 
     private static final String CVS_ID =
       "@(#) $RCSfile: ContentList.java,v $ $Revision: 1.17 $ $Date: 2002/04/29 13:38:15 $ $Name:  $";
@@ -99,7 +98,7 @@
     private static final int REMOVE  = 6;
 
     /** Our backing list */
-//    protected ArrayList list;
+//    protected  java.util.ArrayList list;
     private Object elementData[];
     private int size;
 
@@ -430,7 +429,7 @@
      * @return <code>true</code> if the list was modified as a result of
      *                           the add.
      */
-    public boolean addAll(Collection collection) {
+    public boolean addAll( java.util.Collection collection) {
         return addAll(size(), collection);
     }
 
@@ -445,7 +444,7 @@
      *                           the add.
      * throws IndexOutOfBoundsException if index < 0 || index > size()
      */
-    public boolean addAll(int index, Collection collection) {
+    public boolean addAll(int index,  java.util.Collection collection) {
         if (index<0 || index>size) {
             throw new IndexOutOfBoundsException("Index: " + index +
                                                 " Size: " + size());
@@ -457,7 +456,7 @@
 
         int count = 0;
         try {
-            Iterator i = collection.iterator();
+             java.util.Iterator i = collection.iterator();
             while (i.hasNext()) {
                 Object obj = i.next();
                 add(index + count, obj);
@@ -491,12 +490,12 @@
 
     /**
      * Clear the current list and set it to the contents
-     * of the <code>Collection</code>.
+     * of the <code> java.util.Collection</code>.
      * object.
      *
      * @param collection The collection to use.
      */
-    protected void clearAndSet(Collection collection) {
+    protected void clearAndSet( java.util.Collection collection) {
         Object[] old = elementData;
         int oldSize = size;
 
@@ -566,7 +565,7 @@
      * @param filter <code>Filter</code> for this view.
      * @return a list representing the rules of the <code>Filter</code>.
      */
-    protected List getView(Filter filter) {
+    protected  java.util.List getView(Filter filter) {
         return new FilterList(filter);
     }
 
@@ -639,7 +638,7 @@
     }
 
     /**
-     * Set the object at the specified location to the supplied
+     *  java.util.Set the object at the specified location to the supplied
      * object.
      *
      * @param index The location to set the value to.
@@ -702,7 +701,7 @@
      * for <code>Document</code>s or <code>Element</code>s.
      */
 
-    class FilterList extends AbstractList {
+    class FilterList extends  java.util.AbstractList {
 
         /** The Filter */
         protected Filter filter;
@@ -759,15 +758,15 @@
             return ContentList.this.get(adjusted);
         }
 
-        public Iterator iterator() {
+        public  java.util.Iterator iterator() {
             return new FilterListIterator(filter, 0);
         }
 
-        public ListIterator listIterator() {
+        public  java.util.ListIterator listIterator() {
             return new FilterListIterator(filter, 0);
         }
 
-        public ListIterator listIterator(int index) {
+        public  java.util.ListIterator listIterator(int index) {
             return new FilterListIterator(filter,  index);
         }
 
@@ -795,7 +794,7 @@
         }
 
         /**
-         * Set the object at the specified location to the supplied
+         *  java.util.Set the object at the specified location to the supplied
          * object.
          *
          * @param index The location to set the value to.
@@ -882,7 +881,7 @@
     /* * * * * * * * * * * * * FilterListIterator * * * * * * * * * * * */
     /* * * * * * * * * * * * * FilterListIterator * * * * * * * * * * * */
 
-    class FilterListIterator implements ListIterator {
+    class FilterListIterator implements  java.util.ListIterator {
 
         /** The Filter that applies */
         Filter filter;
@@ -953,7 +952,7 @@
             }
             else {
                 last = ContentList.this.size();
-                throw new NoSuchElementException();
+                throw new  java.util.NoSuchElementException();
             }
 
             lastOperation = NEXT;
@@ -1003,7 +1002,7 @@
             }
             else {
                 last = -1;
-                throw new NoSuchElementException();
+                throw new  java.util.NoSuchElementException();
             }
 
             lastOperation = PREV;
@@ -1205,7 +1204,7 @@
          */
         private void checkConcurrentModification() {
             if (expected != ContentList.this.getModCount()) {
-                throw new ConcurrentModificationException();
+                throw new  java.util.ConcurrentModificationException();
             }
         }
     }
diff -u jdom.orig/Document.java jdom/Document.java
--- jdom.orig/Document.java	Thu May 16 09:32:00 2002
+++ jdom/Document.java	Tue May 21 01:51:31 2002
@@ -133,13 +133,13 @@
      * with the supplied list of content, and the supplied
      * <code>{@link DocType}</code> declaration.
      *
-     * @param content <code>List</code> of starter content
+     * @param content <code> java.util.List</code> of starter content
      * @param docType <code>DocType</code> declaration.
-     * @throws IllegalAddException if (1) the List contains more than
+     * @throws IllegalAddException if (1) the  java.util.List contains more than
      *         one Element or objects of illegal types, or (2) if the
      *         given docType object is already attached to a document.
      */
-    public Document(List newContent, DocType docType) {
+    public Document( java.util.List newContent, DocType docType) {
         setContent(newContent);
         setDocType(docType);
     }
@@ -149,11 +149,11 @@
      * with the supplied list of content, and no
      * <code>{@link DocType}</code> declaration.
      *
-     * @param content <code>List</code> of starter content
-     * @throws IllegalAddException if the List contains more than
+     * @param content <code> java.util.List</code> of starter content
+     * @throws IllegalAddException if the  java.util.List contains more than
      *         one Element or objects of illegal types.
      */
-    public Document(List content) {
+    public Document( java.util.List content) {
         this(content, null);
     }
 
@@ -294,15 +294,15 @@
      * affect the document's actual content.
      *
      * <p>
-     * Sequential traversal through the List is best done with a Iterator
-     * since the underlying implement of List.size() may require walking the
+     * Sequential traversal through the  java.util.List is best done with a  java.util.Iterator
+     * since the underlying implement of  java.util.List.size() may require walking the
      * entire list.
      * </p>
      *
-     * @return <code>List</code> - all Document content
+     * @return <code> java.util.List</code> - all Document content
      * @throws IllegalStateException if the root element hasn't been set
      */
-    public List getContent() {
+    public  java.util.List getContent() {
         if (!hasRootElement())
             throw new IllegalStateException("Root element not set"); 
         return content;
@@ -312,16 +312,16 @@
      * Return a filtered view of this <code>Document</code>'s content.
      *
      * <p>
-     * Sequential traversal through the List is best done with a Iterator
-     * since the underlying implement of List.size() may require walking the
+     * Sequential traversal through the  java.util.List is best done with a  java.util.Iterator
+     * since the underlying implement of  java.util.List.size() may require walking the
      * entire list.
      * </p>
      *
      * @param filter <code>Filter</code> to apply
-     * @return <code>List</code> - filtered Document content
+     * @return <code> java.util.List</code> - filtered Document content
      * @throws IllegalStateException if the root element hasn't been set
      */
-    public List getContent(Filter filter) {
+    public  java.util.List getContent(Filter filter) {
         if (!hasRootElement())
             throw new IllegalStateException("Root element not set"); 
         return content.getView(filter);
@@ -329,18 +329,18 @@
   
     /**
      * This sets the content of the <code>Document</code>.  The supplied
-     * List should contain only objects of type <code>Element</code>,
+     *  java.util.List should contain only objects of type <code>Element</code>,
      * <code>Comment</code>, and <code>ProcessingInstruction</code>.
      *
      * <p>
-     * When all objects in the supplied List are legal and before the new
+     * When all objects in the supplied  java.util.List are legal and before the new
      * content is added, all objects in the old content will have their
      * parentage set to null (no parent) and the old content list will be
      * cleared. This has the effect that any active list (previously obtained
      * with a call to {@link #getContent}) will also
      * change to reflect the new content.  In addition, all objects in the
-     * supplied List will have their parentage set to this document, but the
-     * List itself will not be "live" and further removals and additions will
+     * supplied  java.util.List will have their parentage set to this document, but the
+     *  java.util.List itself will not be "live" and further removals and additions will
      * have no effect on this document content. If the user wants to continue
      * working with a "live" list, then a call to setContent should be
      * followed by a call to {@link #getContent} to
@@ -348,7 +348,7 @@
      * </p>
      *
      * <p>
-     * Passing a null or empty List clears the existing content.
+     * Passing a null or empty  java.util.List clears the existing content.
      * </p>
      *
      * <p>
@@ -356,12 +356,12 @@
      * the objects in the supplied content will be unaltered.
      * </p>
      *
-     * @param newContent <code>List</code> of content to set
+     * @param newContent <code> java.util.List</code> of content to set
      * @return this document modified
-     * @throws IllegalAddException if the List contains objects of
+     * @throws IllegalAddException if the  java.util.List contains objects of
      *         illegal types.
      */
-    public Document setContent(List newContent) {
+    public Document setContent( java.util.List newContent) {
         content.clearAndSet(newContent);
         return this;
     }
diff -u jdom.orig/Element.java jdom/Element.java
--- jdom.orig/Element.java	Fri May 17 08:45:03 2002
+++ jdom/Element.java	Tue May 21 01:51:31 2002
@@ -96,7 +96,7 @@
 
     /** Additional <code>{@link Namespace}</code> declarations on this
         element */
-    protected transient List additionalNamespaces;
+    protected transient  java.util.List additionalNamespaces;
 
     // See http://lists.denveronline.net/lists/jdom-interest/2000-September/003030.html
     // for a possible memory optimization here (using a RootElement subclass)
@@ -351,7 +351,7 @@
         }
 
         if (additionalNamespaces == null) {
-            additionalNamespaces = new ArrayList(INITIAL_ARRAY_SIZE);
+            additionalNamespaces = new  java.util.ArrayList(INITIAL_ARRAY_SIZE);
         }
 
         additionalNamespaces.add(additional);
@@ -382,16 +382,16 @@
      * declarations, this returns an empty list.  Note, the returned
      * list is not live, for performance reasons.
      *
-     * @return <code>List</code> - the additional namespace declarations.
+     * @return <code> java.util.List</code> - the additional namespace declarations.
      */
-    public List getAdditionalNamespaces() {
+    public  java.util.List getAdditionalNamespaces() {
         // Not having the returned list be live allows us to avoid creating a
         // new list object when XMLOutputter calls this method on an element
         // with an empty list.
         if (additionalNamespaces == null) {
-            return Collections.EMPTY_LIST;
+            return  java.util.Collections.EMPTY_LIST;
         }
-        return Collections.unmodifiableList(additionalNamespaces);
+        return  java.util.Collections.unmodifiableList(additionalNamespaces);
     }
 
     /**
@@ -665,7 +665,7 @@
      * All existing text content and non-text context is removed.
      * If this element should have both textual content and nested
      * elements, use <code>{@link #setContent}</code> instead.
-     * Setting a null text value is equivalent to setting an empty string
+     *  java.util.Setting a null text value is equivalent to setting an empty string
      * value.
      *
      * @param text new content for the element
@@ -685,28 +685,28 @@
     }
 
     /**
-     * This returns the full content of the element as a List which
+     * This returns the full content of the element as a  java.util.List which
      * may contain objects of type <code>Text</code>, <code>Element</code>,
      * <code>Comment</code>, <code>ProcessingInstruction</code>,
      * <code>CDATA</code>, and <code>EntityRef</code>.
-     * The List returned is "live" in document order and modifications
+     * The  java.util.List returned is "live" in document order and modifications
      * to it affect the element's actual contents.  Whitespace content is
      * returned in its entirety.
      *
      * <p>
-     * Sequential traversal through the List is best done with an Iterator
-     * since the underlying implement of List.size() may require walking the
+     * Sequential traversal through the  java.util.List is best done with an  java.util.Iterator
+     * since the underlying implement of  java.util.List.size() may require walking the
      * entire list.
      * </p>
      *
-     * @return a <code>List</code> containing the mixed content of the
+     * @return a <code> java.util.List</code> containing the mixed content of the
      *         element: may contain <code>Text</code>,
      *         <code>{@link Element}</code>, <code>{@link Comment}</code>,
      *         <code>{@link ProcessingInstruction}</code>,
      *         <code>{@link CDATA}</code>, and
      *         <code>{@link EntityRef}</code> objects.
      */
-    public List getContent() {
+    public  java.util.List getContent() {
         return content;
     }
 
@@ -714,33 +714,33 @@
      * Return a filter view of this <code>Element</code>'s content.
      *
      * <p>
-     * Sequential traversal through the List is best done with a Iterator
-     * since the underlying implement of List.size() may require walking the
+     * Sequential traversal through the  java.util.List is best done with a  java.util.Iterator
+     * since the underlying implement of  java.util.List.size() may require walking the
      * entire list.
      * </p>
      *
      * @param filter <code>Filter</code> to apply
-     * @return <code>List</code> - filtered Element content 
+     * @return <code> java.util.List</code> - filtered Element content 
      */
-    public List getContent(Filter filter) {
+    public  java.util.List getContent(Filter filter) {
         return content.getView(filter);
     }
 
     /**
-     * This sets the content of the element.  The supplied List should
+     * This sets the content of the element.  The supplied  java.util.List should
      * contain only objects of type <code>Element</code>, <code>Text</code>,
      * <code>CDATA</code>, <code>Comment</code>,
      * <code>ProcessingInstruction</code>, and <code>EntityRef</code>.
      *
      * <p>
-     * When all objects in the supplied List are legal and before the new
+     * When all objects in the supplied  java.util.List are legal and before the new
      * content is added, all objects in the old content will have their
      * parentage set to null (no parent) and the old content list will be
      * cleared. This has the effect that any active list (previously obtained
      * with a call to {@link #getContent} or {@link #getChildren}) will also
      * change to reflect the new content.  In addition, all objects in the
-     * supplied List will have their parentage set to this element, but the
-     * List itself will not be "live" and further removals and additions will
+     * supplied  java.util.List will have their parentage set to this element, but the
+     *  java.util.List itself will not be "live" and further removals and additions will
      * have no effect on this elements content. If the user wants to continue
      * working with a "live" list, then a call to setContent should be
      * followed by a call to {@link #getContent} or {@link #getChildren} to
@@ -748,7 +748,7 @@
      * </p>
      *
      * <p>
-     * Passing a null or empty List clears the existing content.
+     * Passing a null or empty  java.util.List clears the existing content.
      * </p>
      *
      * <p>
@@ -756,27 +756,27 @@
      * the objects in the supplied content will be unaltered.
      * </p>
      *
-     * @param newContent <code>List</code> of content to set
+     * @param newContent <code> java.util.List</code> of content to set
      * @return this element modified
-     * @throws IllegalAddException if the List contains objects of
+     * @throws IllegalAddException if the  java.util.List contains objects of
      *         illegal types.
      */
-    public Element setContent(List newContent) {
+    public Element setContent( java.util.List newContent) {
         content.clearAndSet(newContent);
         return this;
     }
 
     /**
-     * This returns a <code>List</code> of all the child elements
+     * This returns a <code> java.util.List</code> of all the child elements
      * nested directly (one level deep) within this element, as
      * <code>Element</code> objects.  If this target element has no nested
-     * elements, an empty List is returned.  The returned list is "live"
+     * elements, an empty  java.util.List is returned.  The returned list is "live"
      * in document order and changes to it affect the element's actual
      * contents.
      *
      * <p>
-     * Sequential traversal through the List is best done with a Iterator
-     * since the underlying implement of List.size() may not be the most
+     * Sequential traversal through the  java.util.List is best done with a  java.util.Iterator
+     * since the underlying implement of  java.util.List.size() may not be the most
      * efficient.
      * </p>
      *
@@ -785,10 +785,10 @@
      * would have to be obtained with:
      * <pre>
      * <code>
-     *   Iterator itr = (currentElement.getChildren()).iterator();
+     *    java.util.Iterator itr = (currentElement.getChildren()).iterator();
      *   while(itr.hasNext()) {
      *     Element oneLevelDeep = (Element)itr.next();
-     *     List twoLevelsDeep = oneLevelDeep.getChildren();
+     *      java.util.List twoLevelsDeep = oneLevelDeep.getChildren();
      *     // Do something with these children
      *   }
      * </code>
@@ -797,13 +797,13 @@
      *
      * @return list of child <code>Element</code> objects for this element
      */
-    public List getChildren() {
+    public  java.util.List getChildren() {
         return content.getView(new ElementFilter());
     }
 
     /** Remove a range of items from a list */
-    private void removeRange(List list, int start, int end) {
-        ListIterator i = list.listIterator(start);
+    private void removeRange( java.util.List list, int start, int end) {
+         java.util.ListIterator i = list.listIterator(start);
         for (int j = 0; j < (end - start); j++) {
             i.next();
             i.remove();
@@ -811,11 +811,11 @@
     }
 
     /**
-     * This returns a <code>List</code> of all the child elements
+     * This returns a <code> java.util.List</code> of all the child elements
      * nested directly (one level deep) within this element with the given
      * local name and belonging to no namespace, returned as
      * <code>Element</code> objects.  If this target element has no nested
-     * elements with the given name outside a namespace, an empty List
+     * elements with the given name outside a namespace, an empty  java.util.List
      * is returned.  The returned list is "live" in document order
      * and changes to it affect the element's actual contents.
      * <p>
@@ -826,16 +826,16 @@
      * @param name local name for the children to match
      * @return all matching child elements
      */
-    public List getChildren(String name) {
+    public  java.util.List getChildren(String name) {
         return getChildren(name, Namespace.NO_NAMESPACE);
     }
 
     /**
-     * This returns a <code>List</code> of all the child elements
+     * This returns a <code> java.util.List</code> of all the child elements
      * nested directly (one level deep) within this element with the given
      * local name and belonging to the given Namespace, returned as
      * <code>Element</code> objects.  If this target element has no nested
-     * elements with the given name in the given Namespace, an empty List
+     * elements with the given name in the given Namespace, an empty  java.util.List
      * is returned.  The returned list is "live" in document order
      * and changes to it affect the element's actual contents.
      * <p>
@@ -847,7 +847,7 @@
      * @param ns <code>Namespace</code> to search within
      * @return all matching child elements
      */
-    public List getChildren(String name, Namespace ns) {
+    public  java.util.List getChildren(String name, Namespace ns) {
         return content.getView(new ElementFilter(name, ns));
     }
 
@@ -862,8 +862,8 @@
      * @return the first matching child element, or null if not found
      */
     public Element getChild(String name, Namespace ns) {
-        List elements = content.getView(new ElementFilter(name, ns));
-        Iterator i = elements.iterator();
+         java.util.List elements = content.getView(new ElementFilter(name, ns));
+         java.util.Iterator i = elements.iterator();
         if (i.hasNext()) {
             return (Element) i.next();
         }
@@ -1009,8 +1009,8 @@
      * @return whether deletion occurred
      */
     public boolean removeChild(String name, Namespace ns) {
-        List old = content.getView(new ElementFilter(name, ns));
-        Iterator i = old.iterator();
+         java.util.List old = content.getView(new ElementFilter(name, ns));
+         java.util.Iterator i = old.iterator();
         if (i.hasNext()) {
             i.next();
             i.remove();
@@ -1048,8 +1048,8 @@
     public boolean removeChildren(String name, Namespace ns) {
         boolean deletedSome = false;
 
-        List old = content.getView(new ElementFilter(name, ns));
-        Iterator i = old.iterator();
+         java.util.List old = content.getView(new ElementFilter(name, ns));
+         java.util.Iterator i = old.iterator();
         while (i.hasNext()) {
             i.next();
             i.remove();
@@ -1062,7 +1062,7 @@
     /**
      * <p>
      * This returns the complete set of attributes for this element, as a
-     * <code>List</code> of <code>Attribute</code> objects in no particular
+     * <code> java.util.List</code> of <code>Attribute</code> objects in no particular
      * order, or an empty list if there are none.
      * The returned list is "live" and changes to it affect the
      * element's actual attributes.
@@ -1070,7 +1070,7 @@
      *
      * @return attributes for the element
      */
-    public List getAttributes() {
+    public  java.util.List getAttributes() {
         return attributes;
     }
 
@@ -1169,18 +1169,18 @@
 
     /**
      * <p>
-     * This sets the attributes of the element.  The supplied List should
+     * This sets the attributes of the element.  The supplied  java.util.List should
      * contain only objects of type <code>Attribute</code>.
      * </p>
      *
      * <p>
-     * When all objects in the supplied List are legal and before the new
+     * When all objects in the supplied  java.util.List are legal and before the new
      * attributes are added, all old attributes will have their
      * parentage set to null (no parent) and the old attribute list will be
      * cleared. This has the effect that any active attribute list (previously
      * obtained with a call to {@link #getAttributes}) will also change to
      * reflect the new attributes.  In addition, all attributes in the supplied
-     * List will have their parentage set to this element, but the List itself
+     *  java.util.List will have their parentage set to this element, but the  java.util.List itself
      * will not be "live" and further removals and additions will have no
      * effect on this elements attributes. If the user wants to continue
      * working with a "live" attribute list, then a call to setAttributes
@@ -1189,11 +1189,11 @@
      * </p>
      *
      * <p>
-     * Passing a null or empty List clears the existing attributes.
+     * Passing a null or empty  java.util.List clears the existing attributes.
      * </p>
      *
      * <p>
-     * In cases where the List contains duplicate attributes, only the last
+     * In cases where the  java.util.List contains duplicate attributes, only the last
      * one will be retained.  This has the same effect as calling
      * {@link #setAttribute(Attribute)} sequentially.
      * </p>
@@ -1203,14 +1203,14 @@
      * the attributes in the supplied attributes will be unaltered.
      * </p>
      *
-     * @param attributes <code>List</code> of attributes to set
+     * @param attributes <code> java.util.List</code> of attributes to set
      * @return this element modified
-     * @throws IllegalAddException if the List contains objects 
+     * @throws IllegalAddException if the  java.util.List contains objects 
      *         that are not instances of <code>Attribute</code>,
      *         or if any of the <code>Attribute</code> objects have 
      *         conflicting namespace prefixes.
      */
-    public Element setAttributes(List newAttributes) {
+    public Element setAttributes( java.util.List newAttributes) {
         attributes.clearAndSet(newAttributes);
         return this;
     }
@@ -1508,8 +1508,8 @@
 
         // Handle additional namespaces
         if (additionalNamespaces != null) {
-            // Avoid additionalNamespaces.clone() because List isn't Cloneable
-            element.additionalNamespaces = new ArrayList();
+            // Avoid additionalNamespaces.clone() because  java.util.List isn't Cloneable
+            element.additionalNamespaces = new  java.util.ArrayList();
             element.additionalNamespaces.addAll(additionalNamespaces);
         }
 
@@ -1583,8 +1583,8 @@
     public boolean removeChildren() {
         boolean deletedSome = false;
 
-        List old = content.getView(new ElementFilter());
-        Iterator i = old.iterator();
+         java.util.List old = content.getView(new ElementFilter());
+         java.util.Iterator i = old.iterator();
         while (i.hasNext()) {
             i.next();
             i.remove();
@@ -1619,13 +1619,13 @@
      * except only <code>Element</code> objects are allowed in the supplied
      * list.
      *
-     * @deprecated Deprecated in Beta 9, use setContent(List) instead
+     * @deprecated Deprecated in Beta 9, use setContent( java.util.List) instead
      *
-     * @param children <code>List</code> of <code>Element</code> objects to add
+     * @param children <code> java.util.List</code> of <code>Element</code> objects to add
      * @return this element modified
      */
-    public Element setChildren(List children) {
-        List list = content.getView(new ElementFilter());
+    public Element setChildren( java.util.List children) {
+         java.util.List list = content.getView(new ElementFilter());
         // Save initial size
         int size = list.size();
         try {
diff -u jdom.orig/Namespace.java jdom/Namespace.java
--- jdom.orig/Namespace.java	Mon Apr 29 06:38:16 2002
+++ jdom/Namespace.java	Tue May 21 01:51:32 2002
@@ -90,7 +90,7 @@
      * Keys are <i>prefix</i>&amp;<i>URI</i>. 
      * Values are Namespace objects 
      */
-    private static HashMap namespaces;
+    private static  java.util.HashMap namespaces;
 
     /** Define a <code>Namespace</code> for when <i>not</i> in a namespace */
     public static final Namespace NO_NAMESPACE = new Namespace("", "");
@@ -109,7 +109,7 @@
      * It sets up storage and required initial values.
      */
     static {
-        namespaces = new HashMap();
+        namespaces = new  java.util.HashMap();
 
         // Add the "empty" namespace
         namespaces.put("&", NO_NAMESPACE);
diff -u jdom.orig/ProcessingInstruction.java jdom/ProcessingInstruction.java
--- jdom.orig/ProcessingInstruction.java	Mon Apr 29 06:38:16 2002
+++ jdom/ProcessingInstruction.java	Tue May 21 01:51:32 2002
@@ -85,7 +85,7 @@
     protected String rawData;
 
     /** The data for the PI in name/value pairs */
-    protected Map mapData;
+    protected  java.util.Map mapData;
 
     /** Parent element, document, or null if none */
     protected Object parent;
@@ -101,12 +101,12 @@
      * with the specified target and data.
      *
      * @param target <code>String</code> target of PI.
-     * @param data <code>Map</code> data for PI, in
+     * @param data <code> java.util.Map</code> data for PI, in
      *             name/value pairs
      * @throws IllegalTargetException if the given target is illegal
      *         as a processing instruction name.
      */
-    public ProcessingInstruction(String target, Map data) {
+    public ProcessingInstruction(String target,  java.util.Map data) {
         setTarget(target);
         setData(data);
     }
@@ -232,16 +232,16 @@
     }
 
     /**
-     * This will return a <code>List</code> containing the names of the
+     * This will return a <code> java.util.List</code> containing the names of the
      * "attribute" style pieces of name/value pairs in this PI's data.
      *
-     * @return <code>List</code> - the <code>List</code> containing the
+     * @return <code> java.util.List</code> - the <code> java.util.List</code> containing the
      *         "attribute" names.
      */
-    public List getNames() {
-      Set mapDataSet = mapData.entrySet();
-      List nameList = new ArrayList();
-      for (Iterator i = mapDataSet.iterator(); i.hasNext();) {
+    public  java.util.List getNames() {
+       java.util.Set mapDataSet = mapData.entrySet();
+       java.util.List nameList = new  java.util.ArrayList();
+      for ( java.util.Iterator i = mapDataSet.iterator(); i.hasNext();) {
          String wholeSet = (i.next()).toString();
          String attrName = wholeSet.substring(0,(wholeSet.indexOf("=")));
          nameList.add(attrName);
@@ -265,13 +265,13 @@
 
     /**
      * This will set the name/value pairs within the passed
-     * <code>Map</code> as the pairs for the data of
+     * <code> java.util.Map</code> as the pairs for the data of
      * this PI.  The keys should be the pair name
      * and the values should be the pair values.
      *
      * @return <code>ProcessingInstruction</code> - modified PI.
      */
-    public ProcessingInstruction setData(Map data) {
+    public ProcessingInstruction setData( java.util.Map data) {
         // XXX Need to validate the data
         this.rawData = toString(data);
         this.mapData = data;
@@ -324,14 +324,14 @@
     }
 
     /**
-     * This will convert the Map to a string representation.
+     * This will convert the  java.util.Map to a string representation.
      *
-     * @param mapData <code>Map</code> PI data to convert
+     * @param mapData <code> java.util.Map</code> PI data to convert
      */
-    private String toString(Map mapData) {
+    private String toString( java.util.Map mapData) {
         StringBuffer rawData = new StringBuffer();
 
-        Iterator i = mapData.keySet().iterator();
+         java.util.Iterator i = mapData.keySet().iterator();
         while (i.hasNext()) {
             String name = (String)i.next();
             String value = (String)mapData.get(name);
@@ -354,7 +354,7 @@
      *
      * @param rawData <code>String</code> PI data to parse
      */
-    private Map parseData(String rawData) {
+    private  java.util.Map parseData(String rawData) {
         // The parsing here is done largely "by hand" which means the code
         // gets a little tricky/messy.  The following conditions should 
         // now be handled correctly:
@@ -362,11 +362,11 @@
         //   <?pi href = 'http://hi/a=b' ?>     Reads OK
         //   <?pi href\t = \t'http://hi/a=b'?>  Reads OK
         //   <?pi href  =  "http://hi/a=b"?>    Reads OK
-        //   <?pi?>                             Empty Map
-        //   <?pi id=22?>                       Empty Map
-        //   <?pi id='22?>                      Empty Map
+        //   <?pi?>                             Empty  java.util.Map
+        //   <?pi id=22?>                       Empty  java.util.Map
+        //   <?pi id='22?>                      Empty  java.util.Map
 
-        Map data = new HashMap();
+         java.util.Map data = new  java.util.HashMap();
 
         // System.out.println("rawData: " + rawData);
 
@@ -393,7 +393,7 @@
                                      inputData.substring(pos+1));
                     // A null value means a parse error and we return empty!
                     if (bounds == null) {
-                        return new HashMap();
+                        return new  java.util.HashMap();
                     }
                     value = inputData.substring(bounds[0]+pos+1,
                                                 bounds[1]+pos+1);
@@ -415,11 +415,11 @@
             //                          + name + ", '" + value+"')");
 
             // If both a name and a value have been found, then add
-            // them to the data Map
+            // them to the data  java.util.Map
             if (name.length() > 0 && value != null) {
                 //if (data.containsKey(name)) {
                     // A repeat, that's a parse error, so return a null map
-                    //return new HashMap();
+                    //return new  java.util.HashMap();
                 //}
                 //else {
                     data.put(name, value);
@@ -542,7 +542,7 @@
         // must set to null
         pi.parent = null;
 
-        // Create a new Map object for the clone (since Map isn't Cloneable)
+        // Create a new  java.util.Map object for the clone (since  java.util.Map isn't Cloneable)
         if (mapData != null) {
             pi.mapData = parseData(rawData);
         }
diff -u jdom.orig/Verifier.java jdom/Verifier.java
--- jdom.orig/Verifier.java	Thu May 16 22:53:53 2002
+++ jdom/Verifier.java	Tue May 21 01:51:32 2002
@@ -390,18 +390,18 @@
      * from a list of objects.
      *
      * @param namespace <code>Namespace</code> to check.
-     * @param list <code>List</code> to check against.
+     * @param list <code> java.util.List</code> to check against.
      * @return <code>String</code> - reason for collision, or
      *         <code>null</code> if no collision.
      */
     public static String checkNamespaceCollision(Namespace namespace,
-                                                       List list) {
+                                                        java.util.List list) {
         if (list == null) {
             return null;
         }
 
         String reason = null;
-        Iterator i = list.iterator();
+         java.util.Iterator i = list.iterator();
         while ((reason == null) && i.hasNext()) {
             Object obj = i.next();
             if (obj instanceof Attribute) {
Common subdirectories: jdom.orig/adapters and jdom/adapters
Common subdirectories: jdom.orig/filter and jdom/filter
Common subdirectories: jdom.orig/input and jdom/input
Common subdirectories: jdom.orig/output and jdom/output
Only in jdom.orig: test
Common subdirectories: jdom.orig/transform and jdom/transform
Common subdirectories: jdom.orig/xpath and jdom/xpath


More information about the jdom-interest mailing list