[jdom-interest] type safety

Filippo Carone f.carone at fastwebnet.it
Thu Nov 25 09:33:04 PST 2004


* Jason Hunter (jhunter at xquery.com) ha scritto:
> >J2SE 5.0. Should I send you the patch for a review?
> 
> Sure, fire away.
> 

 The patch is attached. It has to be applied on the stable 1.0 jdom
release, I haven't tried it on the cvs version.

 cheers,
 fc
-------------- next part --------------
diff -Nru a/src/java/org/jdom/adapters/JAXPDOMAdapter.java b/src/java/org/jdom/adapters/JAXPDOMAdapter.java
--- a/src/java/org/jdom/adapters/JAXPDOMAdapter.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/adapters/JAXPDOMAdapter.java	1970-01-01 00:00:00.000000000 +0100
@@ -100,8 +100,8 @@
 
             // factory = DocumentBuilderFactory.newInstance();
             Method newParserInstance =
-                factoryClass.getMethod("newInstance", null);
-            Object factory = newParserInstance.invoke(null, null);
+                factoryClass.getMethod("newInstance", (Class[])null);
+            Object factory = newParserInstance.invoke(null,(Object[]) null);
 
             // factory.setValidating(validate);
             Method setValidating =
@@ -119,8 +119,8 @@
     
             // jaxpParser = factory.newDocumentBuilder();
             Method newDocBuilder =
-                factoryClass.getMethod("newDocumentBuilder", null);
-            Object jaxpParser  = newDocBuilder.invoke(factory, null);
+                factoryClass.getMethod("newDocumentBuilder", (Class[])null);
+            Object jaxpParser  = newDocBuilder.invoke(factory, (Object[])null);
 
             // jaxpParser.setErrorHandler(null);
             Class parserClass = jaxpParser.getClass();
@@ -172,19 +172,19 @@
 
             // factory = DocumentBuilderFactory.newInstance();
             Method newParserInstance =
-                factoryClass.getMethod("newInstance", null);
-            Object factory = newParserInstance.invoke(null, null);
+                factoryClass.getMethod("newInstance", (Class[])null);
+            Object factory = newParserInstance.invoke(null, (Object[])null);
 
             // jaxpParser = factory.newDocumentBuilder();
             Method newDocBuilder =
-                factoryClass.getMethod("newDocumentBuilder", null);
-            Object jaxpParser  = newDocBuilder.invoke(factory, null);
+                factoryClass.getMethod("newDocumentBuilder", (Class[])null);
+            Object jaxpParser  = newDocBuilder.invoke(factory, (Object[])null);
 
             // domDoc = jaxpParser.newDocument();
             Class parserClass = jaxpParser.getClass();
-            Method newDoc = parserClass.getMethod("newDocument", null);
+            Method newDoc = parserClass.getMethod("newDocument", (Class[])null);
             org.w3c.dom.Document domDoc =
-                (org.w3c.dom.Document) newDoc.invoke(jaxpParser, null);
+                (org.w3c.dom.Document) newDoc.invoke(jaxpParser, (Object[])null);
 
             return domDoc;
         } catch (Exception e) {
diff -Nru a/src/java/org/jdom/adapters/OracleV1DOMAdapter.java b/src/java/org/jdom/adapters/OracleV1DOMAdapter.java
--- a/src/java/org/jdom/adapters/OracleV1DOMAdapter.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/adapters/OracleV1DOMAdapter.java	1970-01-01 00:00:00.000000000 +0100
@@ -101,8 +101,8 @@
             parse.invoke(parser, new Object[] {new InputSource(in)});
 
             // Get the Document object
-            Method getDocument = parserClass.getMethod("getDocument", null);
-            Document doc = (Document)getDocument.invoke(parser, null);
+            Method getDocument = parserClass.getMethod("getDocument", (Class[])null);
+            Document doc = (Document)getDocument.invoke(parser, (Object[]) null);
 
             return doc;
         } catch (InvocationTargetException e) {
diff -Nru a/src/java/org/jdom/adapters/OracleV2DOMAdapter.java b/src/java/org/jdom/adapters/OracleV2DOMAdapter.java
--- a/src/java/org/jdom/adapters/OracleV2DOMAdapter.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/adapters/OracleV2DOMAdapter.java	1970-01-01 00:00:00.000000000 +0100
@@ -101,8 +101,8 @@
             parse.invoke(parser, new Object[] {new InputSource(in)});
 
             // Get the Document object
-            Method getDocument = parserClass.getMethod("getDocument", null);
-            Document doc = (Document)getDocument.invoke(parser, null);
+            Method getDocument = parserClass.getMethod("getDocument", (Class[])null);
+            Document doc = (Document)getDocument.invoke(parser, (Object[])null);
 
             return doc;
         } catch (InvocationTargetException e) {
diff -Nru a/src/java/org/jdom/adapters/XercesDOMAdapter.java b/src/java/org/jdom/adapters/XercesDOMAdapter.java
--- a/src/java/org/jdom/adapters/XercesDOMAdapter.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/adapters/XercesDOMAdapter.java	1970-01-01 00:00:00.000000000 +0100
@@ -126,8 +126,8 @@
             parse.invoke(parser, new Object[]{new InputSource(in)});
 
             // Get the Document object
-            Method getDocument = parserClass.getMethod("getDocument", null);
-            Document doc = (Document)getDocument.invoke(parser, null);
+            Method getDocument = parserClass.getMethod("getDocument", (Class[])null);
+            Document doc = (Document)getDocument.invoke(parser, (Object[])null);
 
             return doc;
         } catch (InvocationTargetException e) {
diff -Nru a/src/java/org/jdom/adapters/XML4JDOMAdapter.java b/src/java/org/jdom/adapters/XML4JDOMAdapter.java
--- a/src/java/org/jdom/adapters/XML4JDOMAdapter.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/adapters/XML4JDOMAdapter.java	1970-01-01 00:00:00.000000000 +0100
@@ -127,8 +127,8 @@
             parse.invoke(parser, new Object[]{new InputSource(in)});
 
             // Get the Document object
-            Method getDocument = parserClass.getMethod("getDocument", null);
-            Document doc = (Document)getDocument.invoke(parser, null);
+            Method getDocument = parserClass.getMethod("getDocument", (Class[])null);
+            Document doc = (Document)getDocument.invoke(parser, (Object[]) null);
 
             return doc;
         } catch (InvocationTargetException e) {
diff -Nru a/src/java/org/jdom/Attribute.java b/src/java/org/jdom/Attribute.java
--- a/src/java/org/jdom/Attribute.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/Attribute.java	1970-01-01 00:00:00.000000000 +0100
@@ -70,9 +70,16 @@
  */
 public class Attribute implements Serializable, Cloneable {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3257001068671088948L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: Attribute.java,v $ $Revision: 1.52 $ $Date: 2004/03/01 23:58:28 $ $Name: jdom_1_0 $";
 
+	
+	
     /**
      * Attribute type: the attribute has not been declared or type
      * is unknown.
diff -Nru a/src/java/org/jdom/AttributeList.java b/src/java/org/jdom/AttributeList.java
--- a/src/java/org/jdom/AttributeList.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/AttributeList.java	1970-01-01 00:00:00.000000000 +0100
@@ -77,7 +77,12 @@
 class AttributeList extends AbstractList
                     implements List, java.io.Serializable {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3906086758750894384L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: AttributeList.java,v $ $Revision: 1.23 $ $Date: 2004/02/28 03:30:27 $ $Name: jdom_1_0 $";
 
     private static final int INITIAL_ARRAY_SIZE = 5;
diff -Nru a/src/java/org/jdom/CDATA.java b/src/java/org/jdom/CDATA.java
--- a/src/java/org/jdom/CDATA.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/CDATA.java	1970-01-01 00:00:00.000000000 +0100
@@ -71,7 +71,11 @@
  */
 public class CDATA extends Text {
 
-    private static final String CVS_ID = 
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3258412828749476153L;
+	private static final String CVS_ID = 
       "@(#) $RCSfile: CDATA.java,v $ $Revision: 1.30 $ $Date: 2004/02/27 11:32:57 $ $Name: jdom_1_0 $";
 
     /**
diff -Nru a/src/java/org/jdom/Comment.java b/src/java/org/jdom/Comment.java
--- a/src/java/org/jdom/Comment.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/Comment.java	1970-01-01 00:00:00.000000000 +0100
@@ -66,7 +66,12 @@
  */
 public class Comment extends Content {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3256445823838861105L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: Comment.java,v $ $Revision: 1.32 $ $Date: 2004/02/11 21:12:43 $ $Name: jdom_1_0 $";
 
     /** Text of the <code>Comment</code> */
diff -Nru a/src/java/org/jdom/Content.java b/src/java/org/jdom/Content.java
--- a/src/java/org/jdom/Content.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/Content.java	1970-01-01 00:00:00.000000000 +0100
@@ -155,7 +155,7 @@
      *
      * @return a detached deep copy of this child and descendants
      */
-    public Object clone() {
+    public Content clone() {
         try {
             Content c = (Content)super.clone();
             c.parent = null;
diff -Nru a/src/java/org/jdom/ContentList.java b/src/java/org/jdom/ContentList.java
--- a/src/java/org/jdom/ContentList.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/ContentList.java	1970-01-01 00:00:00.000000000 +0100
@@ -77,9 +77,14 @@
  * @author  Philippe Riand
  * @author  Bradley S. Huffman
  */
-final class ContentList extends AbstractList implements java.io.Serializable {
+final class ContentList extends AbstractList<Content> implements java.io.Serializable {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3256719593778328632L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: ContentList.java,v $ $Revision: 1.39 $ $Date: 2004/02/28 03:30:27 $ $Name: jdom_1_0 $";
 
     private static final int INITIAL_ARRAY_SIZE = 5;
@@ -197,7 +202,7 @@
      * @param index index where to add <code>Element</code>
      * @param child <code>Element</code> to add
      */
-    void add(int index, Content child) {
+    public void add(int index, Content child) {
         if (child == null) {
             throw new IllegalAddException("Cannot add null object");
         }
@@ -381,7 +386,7 @@
      * @param index The offset of the object.
      * @return The Object which was returned.
      */
-    public Object get(int index) {
+    public Content get(int index) {
         if (index<0 || index>=size) {
             throw new IndexOutOfBoundsException("Index: " + index +
                                                 " Size: " + size());
@@ -441,7 +446,7 @@
      * @param index The offset of the object.
      * @return The Object which was removed.
      */
-    public Object remove(int index) {
+    public Content remove(int index) {
         if (index<0 || index>=size)
             throw new IndexOutOfBoundsException("Index: " + index +
                                                  " Size: " + size());
@@ -536,7 +541,14 @@
 
     class FilterList extends AbstractList implements java.io.Serializable {
 
-        /** The Filter */
+        
+
+		/**
+		 * Comment for <code>serialVersionUID</code>
+		 */
+		private static final long serialVersionUID = 3904965252578947892L;
+
+		/** The Filter */
         Filter filter;
 
         /** Current number of items in this view */
diff -Nru a/src/java/org/jdom/DataConversionException.java b/src/java/org/jdom/DataConversionException.java
--- a/src/java/org/jdom/DataConversionException.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/DataConversionException.java	1970-01-01 00:00:00.000000000 +0100
@@ -66,7 +66,11 @@
  */
 public class DataConversionException extends JDOMException {
 
-    private static final String CVS_ID = 
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3256999943490582322L;
+	private static final String CVS_ID = 
       "@(#) $RCSfile: DataConversionException.java,v $ $Revision: 1.13 $ $Date: 2004/02/06 09:28:30 $ $Name: jdom_1_0 $";
 
     /**
diff -Nru a/src/java/org/jdom/DefaultJDOMFactory.java b/src/java/org/jdom/DefaultJDOMFactory.java
--- a/src/java/org/jdom/DefaultJDOMFactory.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/DefaultJDOMFactory.java	1970-01-01 00:00:00.000000000 +0100
@@ -147,7 +147,7 @@
     }
 
     public ProcessingInstruction processingInstruction(String target,
-                                                       Map data) {
+                                                       Map<String, String> data) {
         return new ProcessingInstruction(target, data);
     }
 
diff -Nru a/src/java/org/jdom/DescendantIterator.java b/src/java/org/jdom/DescendantIterator.java
--- a/src/java/org/jdom/DescendantIterator.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/DescendantIterator.java	1970-01-01 00:00:00.000000000 +0100
@@ -73,7 +73,7 @@
 
     private Iterator iterator;
     private Iterator nextIterator;
-    private List stack = new ArrayList();
+    private List<Iterator> stack = new ArrayList<Iterator>();
 
     private static final String CVS_ID =
             "@(#) $RCSfile: DescendantIterator.java,v $ $Revision: 1.5 $ $Date: 2004/02/27 11:32:57 $ $Name: jdom_1_0 $";
diff -Nru a/src/java/org/jdom/DocType.java b/src/java/org/jdom/DocType.java
--- a/src/java/org/jdom/DocType.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/DocType.java	1970-01-01 00:00:00.000000000 +0100
@@ -66,7 +66,12 @@
  */
 public class DocType extends Content {
 
-    private static final String CVS_ID =
+ 	/**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3833183631647782711L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: DocType.java,v $ $Revision: 1.31 $ $Date: 2004/02/27 11:32:57 $ $Name: jdom_1_0 $";
 
     /** The element being constrained */
diff -Nru a/src/java/org/jdom/Document.java b/src/java/org/jdom/Document.java
--- a/src/java/org/jdom/Document.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/Document.java	1970-01-01 00:00:00.000000000 +0100
@@ -71,7 +71,12 @@
  */
 public class Document implements Parent {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3257004362994823221L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: Document.java,v $ $Revision: 1.84 $ $Date: 2004/08/31 21:47:51 $ $Name: jdom_1_0 $";
 
     /**
@@ -88,7 +93,7 @@
     protected String baseURI = null;
 
     // Supports the setProperty/getProperty calls
-    private HashMap propertyMap = null;
+    private HashMap<String, Object> propertyMap = null;
 
     /**
      * Creates a new empty document.  A document must have a root element,
@@ -370,9 +375,9 @@
         return this;
     }
 
-    public List cloneContent() {
+    public List<Content> cloneContent() {
         int size = getContentSize();
-        List list = new ArrayList(size);
+        List<Content> list = new ArrayList<Content>(size);
         for (int i = 0; i < size; i++) {
             Content child = getContent(i);
             list.add(child.clone());
@@ -403,7 +408,7 @@
      * @return <code>List</code> - all Document content
      * @throws IllegalStateException if the root element hasn't been set
      */
-    public List getContent() {
+    public List<Content> getContent() {
         if (!hasRootElement())
             throw new IllegalStateException("Root element not set");
         return content;
@@ -434,7 +439,7 @@
      * @return list of the old children detached from this parent
      */
     public List removeContent() {
-        List old = new ArrayList(content);
+        List<Content> old = new ArrayList<Content>(content);
         content.clear();
         return old;
     }
@@ -446,7 +451,7 @@
      * @return list of the old children detached from this parent
      */
     public List removeContent(Filter filter) {
-        List old = new ArrayList();
+        List<Content> old = new ArrayList<Content>();
         Iterator itr = content.getView(filter).iterator();
         while (itr.hasNext()) {
             Content child = (Content) itr.next();
@@ -747,7 +752,7 @@
      */
     public void setProperty(String id, Object value) {
         if (propertyMap == null) {
-            propertyMap = new HashMap();
+            propertyMap = new HashMap<String, Object>();
         }
         propertyMap.put(id, value);
     }
diff -Nru a/src/java/org/jdom/Element.java b/src/java/org/jdom/Element.java
--- a/src/java/org/jdom/Element.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/Element.java	1970-01-01 00:00:00.000000000 +0100
@@ -80,7 +80,12 @@
  */
 public class Element extends Content implements Parent {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3906087832459032117L;
+
+	private static final String CVS_ID =
     "@(#) $RCSfile: Element.java,v $ $Revision: 1.152 $ $Date: 2004/09/03 06:35:39 $ $Name: jdom_1_0 $";
 
     private static final int INITIAL_ARRAY_SIZE = 5;
@@ -93,7 +98,7 @@
 
     /** Additional namespace declarations to store on this element; useful
      * during output */
-    protected transient List additionalNamespaces;
+    protected transient List<Namespace> additionalNamespaces;
 
     // See http://lists.denveronline.net/lists/jdom-interest/2000-September/003030.html
     // for a possible memory optimization here (using a RootElement subclass)
@@ -342,7 +347,7 @@
         }
 
         if (additionalNamespaces == null) {
-            additionalNamespaces = new ArrayList(INITIAL_ARRAY_SIZE);
+            additionalNamespaces = new ArrayList<Namespace>(INITIAL_ARRAY_SIZE);
         }
 
         additionalNamespaces.add(additional);
@@ -655,7 +660,7 @@
      *         <code>{@link CDATA}</code>, and
      *         <code>{@link EntityRef}</code> objects.
      */
-    public List getContent() {
+    public List<Content> getContent() {
         return content;
     }
 
@@ -681,7 +686,7 @@
      * @return list of the old children detached from this parent
      */
     public List removeContent() {
-        List old = new ArrayList(content);
+        List old = new ArrayList<Content>(content);
         content.clear();
         return old;
     }
@@ -693,7 +698,7 @@
      * @return list of the old children detached from this parent
      */
     public List removeContent(Filter filter) {
-        List old = new ArrayList();
+        List<Content> old = new ArrayList<Content>();
         Iterator itr = content.getView(filter).iterator();
         while (itr.hasNext()) {
             Content child = (Content) itr.next();
@@ -860,9 +865,9 @@
         return this;
     }
 
-    public List cloneContent() {
+    public List<Content> cloneContent() {
         int size = getContentSize();
-        List list = new ArrayList(size);
+        List<Content> list = new ArrayList<Content>(size);
         for (int i = 0; i < size; i++) {
             Content child = getContent(i);
             list.add(child.clone());
@@ -1227,7 +1232,7 @@
      *
      * @return the clone of this element
      */
-    public Object clone() {
+    public Element clone() {
 
         // Ken Rune Helland <kenh at csc.no> is our local clone() guru
 
@@ -1260,9 +1265,9 @@
         // Cloning additional namespaces
         if (additionalNamespaces != null) {
             int additionalSize = additionalNamespaces.size();
-            element.additionalNamespaces = new ArrayList(additionalSize);
+            element.additionalNamespaces = new ArrayList<Namespace>(additionalSize);
             for (int i = 0; i < additionalSize; i++) {
-                Object additional = additionalNamespaces.get(i);
+                Namespace additional = additionalNamespaces.get(i);
                 element.additionalNamespaces.add(additional);
             }
         }
@@ -1297,7 +1302,7 @@
         // Handle additional namespaces
         if (additionalNamespaces != null) {
             // Avoid additionalNamespaces.clone() because List isn't Cloneable
-            element.additionalNamespaces = new ArrayList();
+            element.additionalNamespaces = new ArrayList<Namespace>();
             element.additionalNamespaces.addAll(additionalNamespaces);
         }
 
@@ -1340,7 +1345,7 @@
         int size = in.read();
 
         if (size != 0) {
-            additionalNamespaces = new ArrayList(size);
+            additionalNamespaces = new ArrayList<Namespace>(size);
             for (int i = 0; i < size; i++) {
                 Namespace additional = Namespace.getNamespace(
                     (String)in.readObject(), (String)in.readObject());
diff -Nru a/src/java/org/jdom/EntityRef.java b/src/java/org/jdom/EntityRef.java
--- a/src/java/org/jdom/EntityRef.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/EntityRef.java	1970-01-01 00:00:00.000000000 +0100
@@ -67,7 +67,12 @@
  */
 public class EntityRef extends Content {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3762530101056715058L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: EntityRef.java,v $ $Revision: 1.21 $ $Date: 2004/02/27 11:32:57 $ $Name: jdom_1_0 $";
 
     /** The name of the <code>EntityRef</code> */
diff -Nru a/src/java/org/jdom/filter/AndFilter.java b/src/java/org/jdom/filter/AndFilter.java
--- a/src/java/org/jdom/filter/AndFilter.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/filter/AndFilter.java	1970-01-01 00:00:00.000000000 +0100
@@ -65,7 +65,12 @@
  */
 final class AndFilter extends AbstractFilter {
 
-    private static final String CVS_ID = 
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3256440292021252153L;
+
+	private static final String CVS_ID = 
       "@(#) $RCSfile: AndFilter.java,v $ $Revision: 1.3 $ $Date: 2004/02/06 09:28:31 $";
 
     // Filter for left side of logical <b>and</b>.
diff -Nru a/src/java/org/jdom/filter/ContentFilter.java b/src/java/org/jdom/filter/ContentFilter.java
--- a/src/java/org/jdom/filter/ContentFilter.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/filter/ContentFilter.java	1970-01-01 00:00:00.000000000 +0100
@@ -84,7 +84,12 @@
  */
 public class ContentFilter extends AbstractFilter {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3256999960653083186L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: ContentFilter.java,v $ $Revision: 1.14 $ $Date: 2004/08/31 04:56:07 $ $Name: jdom_1_0 $";
 
     /** Mask for JDOM {@link Element} objects */
diff -Nru a/src/java/org/jdom/filter/ElementFilter.java b/src/java/org/jdom/filter/ElementFilter.java
--- a/src/java/org/jdom/filter/ElementFilter.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/filter/ElementFilter.java	1970-01-01 00:00:00.000000000 +0100
@@ -68,7 +68,12 @@
  */
 public class ElementFilter extends AbstractFilter {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3833752070536050483L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: ElementFilter.java,v $ $Revision: 1.18 $ $Date: 2004/09/07 06:37:20 $ $Name: jdom_1_0 $";
 
     /** The element name */
diff -Nru a/src/java/org/jdom/filter/NegateFilter.java b/src/java/org/jdom/filter/NegateFilter.java
--- a/src/java/org/jdom/filter/NegateFilter.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/filter/NegateFilter.java	1970-01-01 00:00:00.000000000 +0100
@@ -65,7 +65,12 @@
  */
 final class NegateFilter extends AbstractFilter {
 
-    private static final String CVS_ID = 
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3833746573011072308L;
+
+	private static final String CVS_ID = 
       "@(#) $RCSfile: NegateFilter.java,v $ $Revision: 1.3 $ $Date: 2004/02/06 09:28:31 $";
 
     // Underlying filter.
diff -Nru a/src/java/org/jdom/filter/OrFilter.java b/src/java/org/jdom/filter/OrFilter.java
--- a/src/java/org/jdom/filter/OrFilter.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/filter/OrFilter.java	1970-01-01 00:00:00.000000000 +0100
@@ -65,7 +65,12 @@
  */
 final class OrFilter extends AbstractFilter {
 
-    private static final String CVS_ID = 
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3258410646839046195L;
+
+	private static final String CVS_ID = 
       "@(#) $RCSfile: OrFilter.java,v $ $Revision: 1.4 $ $Date: 2004/02/06 09:28:31 $";
 
     /** Filter for left side of logical <b>or</b> */
diff -Nru a/src/java/org/jdom/IllegalAddException.java b/src/java/org/jdom/IllegalAddException.java
--- a/src/java/org/jdom/IllegalAddException.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/IllegalAddException.java	1970-01-01 00:00:00.000000000 +0100
@@ -65,7 +65,11 @@
  */
 public class IllegalAddException extends IllegalArgumentException {
 
-    private static final String CVS_ID = 
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 4050485629383226678L;
+	private static final String CVS_ID = 
       "@(#) $RCSfile: IllegalAddException.java,v $ $Revision: 1.25 $ $Date: 2004/02/06 09:28:30 $ $Name: jdom_1_0 $";
 
     /**
diff -Nru a/src/java/org/jdom/IllegalDataException.java b/src/java/org/jdom/IllegalDataException.java
--- a/src/java/org/jdom/IllegalDataException.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/IllegalDataException.java	1970-01-01 00:00:00.000000000 +0100
@@ -65,7 +65,11 @@
  */
 public class IllegalDataException extends IllegalArgumentException {
 
-    private static final String CVS_ID = 
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3258132436071559734L;
+	private static final String CVS_ID = 
       "@(#) $RCSfile: IllegalDataException.java,v $ $Revision: 1.13 $ $Date: 2004/02/06 09:28:30 $ $Name: jdom_1_0 $";
 
     /**
diff -Nru a/src/java/org/jdom/IllegalNameException.java b/src/java/org/jdom/IllegalNameException.java
--- a/src/java/org/jdom/IllegalNameException.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/IllegalNameException.java	1970-01-01 00:00:00.000000000 +0100
@@ -66,7 +66,11 @@
  */
 public class IllegalNameException extends IllegalArgumentException {
 
-    private static final String CVS_ID = 
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 4121138038937368880L;
+	private static final String CVS_ID = 
       "@(#) $RCSfile: IllegalNameException.java,v $ $Revision: 1.13 $ $Date: 2004/02/06 09:28:30 $ $Name: jdom_1_0 $";
 
     /**
diff -Nru a/src/java/org/jdom/IllegalTargetException.java b/src/java/org/jdom/IllegalTargetException.java
--- a/src/java/org/jdom/IllegalTargetException.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/IllegalTargetException.java	1970-01-01 00:00:00.000000000 +0100
@@ -65,7 +65,11 @@
  */
 public class IllegalTargetException extends IllegalArgumentException {
 
-    private static final String CVS_ID = 
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3905523783077803571L;
+	private static final String CVS_ID = 
       "@(#) $RCSfile: IllegalTargetException.java,v $ $Revision: 1.14 $ $Date: 2004/02/06 09:28:30 $ $Name: jdom_1_0 $";
 
     /**
diff -Nru a/src/java/org/jdom/input/JDOMParseException.java b/src/java/org/jdom/input/JDOMParseException.java
--- a/src/java/org/jdom/input/JDOMParseException.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/input/JDOMParseException.java	1970-01-01 00:00:00.000000000 +0100
@@ -68,7 +68,12 @@
  */
 public class JDOMParseException extends JDOMException {
 
-    private static final String CVS_ID =
+	/**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3257005462506582840L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: JDOMParseException.java,v $ $Revision: 1.7 $ $Date: 2004/02/17 02:29:24 $ $Name: jdom_1_0 $";
 
     /**
diff -Nru a/src/java/org/jdom/input/SAXBuilder.java b/src/java/org/jdom/input/SAXBuilder.java
--- a/src/java/org/jdom/input/SAXBuilder.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/input/SAXBuilder.java	1970-01-01 00:00:00.000000000 +0100
@@ -126,10 +126,10 @@
     private boolean ignoringWhite = false;
 
     /** User-specified features to be set on the SAX parser */
-    private HashMap features = new HashMap(5);
+    private HashMap<String, Boolean> features = new HashMap<String, Boolean>(5);
 
     /** User-specified properties to be set on the SAX parser */
-    private HashMap properties = new HashMap(5);
+    private HashMap<String, Object> properties = new HashMap<String, Object>(5);
 
     /**
      * Whether parser reuse is allowed.
diff -Nru a/src/java/org/jdom/input/SAXHandler.java b/src/java/org/jdom/input/SAXHandler.java
--- a/src/java/org/jdom/input/SAXHandler.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/input/SAXHandler.java	1970-01-01 00:00:00.000000000 +0100
@@ -81,7 +81,7 @@
       "@(#) $RCSfile: SAXHandler.java,v $ $Revision: 1.68 $ $Date: 2004/08/31 06:14:05 $ $Name: jdom_1_0 $";
 
     /** Hash table to map SAX attribute type names to JDOM attribute types. */
-    private static final Map attrNameToTypeMap = new HashMap(13);
+    private static final Map<String,Integer> attrNameToTypeMap = new HashMap<String, Integer>(13);
 
     /** <code>Document</code> object being built */
     private Document document;
@@ -118,7 +118,7 @@
 
     /** Temporary holder for namespaces that have been declared with
       * startPrefixMapping, but are not yet available on the element */
-    private List declaredNamespaces;
+    private List<Namespace> declaredNamespaces;
 
     /** Temporary holder for the internal subset */
     private StringBuffer internalSubset = new StringBuffer();
@@ -127,7 +127,7 @@
     private TextBuffer textBuffer = new TextBuffer();
 
     /** The external entities defined in this document */
-    private Map externalEntities;
+    private Map<String, String[]> externalEntities;
 
     /** The JDOMFactory used for JDOM object creation */
     private JDOMFactory factory;
@@ -202,8 +202,8 @@
         }
 
         atRoot = true;
-        declaredNamespaces = new ArrayList();
-        externalEntities = new HashMap();
+        declaredNamespaces = new ArrayList<Namespace>();
+        externalEntities = new HashMap<String, String[]>();
 
         document = this.factory.document(null);
     }
diff -Nru a/src/java/org/jdom/JDOMException.java b/src/java/org/jdom/JDOMException.java
--- a/src/java/org/jdom/JDOMException.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/JDOMException.java	1970-01-01 00:00:00.000000000 +0100
@@ -75,7 +75,12 @@
  */
 public class JDOMException extends Exception {
 
-    private static final String CVS_ID = 
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3616446782989547057L;
+
+	private static final String CVS_ID = 
       "@(#) $RCSfile: JDOMException.java,v $ $Revision: 1.23 $ $Date: 2004/02/27 11:32:57 $ $Name: jdom_1_0 $";
 
     /** A wrapped <code>Throwable</code> */
diff -Nru a/src/java/org/jdom/JDOMFactory.java b/src/java/org/jdom/JDOMFactory.java
--- a/src/java/org/jdom/JDOMFactory.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/JDOMFactory.java	1970-01-01 00:00:00.000000000 +0100
@@ -285,7 +285,7 @@
      *             name/value pairs
      */
     public ProcessingInstruction processingInstruction(String target,
-                                                       Map data);
+                                                       Map<String, String> data);
 
     /**
      * This will create a new <code>ProcessingInstruction</code>
diff -Nru a/src/java/org/jdom/Namespace.java b/src/java/org/jdom/Namespace.java
--- a/src/java/org/jdom/Namespace.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/Namespace.java	1970-01-01 00:00:00.000000000 +0100
@@ -91,7 +91,7 @@
      * Keys are <i>prefix</i>&amp;<i>URI</i>. 
      * Values are Namespace objects 
      */
-    private static HashMap namespaces;
+    private static HashMap<String, Namespace> namespaces;
 
     /** Define a <code>Namespace</code> for when <i>not</i> in a namespace */
     public static final Namespace NO_NAMESPACE = new Namespace("", "");
@@ -111,7 +111,7 @@
      * It sets up storage and required initial values.
      */
     static {
-        namespaces = new HashMap();
+        namespaces = new HashMap<String, Namespace>();
 
         // Add the "empty" namespace
         namespaces.put("&", NO_NAMESPACE);
diff -Nru a/src/java/org/jdom/output/Format.java b/src/java/org/jdom/output/Format.java
--- a/src/java/org/jdom/output/Format.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/output/Format.java	1970-01-01 00:00:00.000000000 +0100
@@ -457,8 +457,8 @@
                     Class encoderClass = Class.forName("java.nio.charset.CharsetEncoder");
                     Method forName = charsetClass.getMethod("forName", new Class[]{String.class});
                     Object charsetObj = forName.invoke(null, new Object[]{encoding});
-                    Method newEncoder = charsetClass.getMethod("newEncoder", null);
-                    encoder = newEncoder.invoke(charsetObj, null);
+                    Method newEncoder = charsetClass.getMethod("newEncoder", (Class[])null);
+                    encoder = newEncoder.invoke(charsetObj, (Object[]) null);
                     canEncode = encoderClass.getMethod("canEncode", new Class[]{char.class});
                 }
                 catch (Exception ignored) {
diff -Nru a/src/java/org/jdom/output/NamespaceStack.java b/src/java/org/jdom/output/NamespaceStack.java
--- a/src/java/org/jdom/output/NamespaceStack.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/output/NamespaceStack.java	1970-01-01 00:00:00.000000000 +0100
@@ -75,17 +75,17 @@
       "@(#) $RCSfile: NamespaceStack.java,v $ $Revision: 1.13 $ $Date: 2004/02/06 09:28:32 $ $Name: jdom_1_0 $";
 
     /** The prefixes available */
-    private Stack prefixes;
+    private Stack<String> prefixes;
 
     /** The URIs available */
-    private Stack uris;        
+    private Stack<String> uris;        
 
     /**
      * This creates the needed storage.
      */
     NamespaceStack() {
-        prefixes = new Stack();
-        uris = new Stack();
+        prefixes = new Stack<String>();
+        uris = new Stack<String>();
     }
   
     /**
diff -Nru a/src/java/org/jdom/output/SAXOutputter.java b/src/java/org/jdom/output/SAXOutputter.java
--- a/src/java/org/jdom/output/SAXOutputter.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/output/SAXOutputter.java	1970-01-01 00:00:00.000000000 +0100
@@ -1302,18 +1302,18 @@
 
             // factory = SAXParserFactory.newInstance();
             Method newParserInstance =
-                    factoryClass.getMethod("newInstance", null);
-            Object factory = newParserInstance.invoke(null, null);
+                    factoryClass.getMethod("newInstance", (Class[])null);
+            Object factory = newParserInstance.invoke(null, (Object[])null);
 
             // jaxpParser = factory.newSAXParser();
-            Method newSAXParser = factoryClass.getMethod("newSAXParser", null);
-            Object jaxpParser   = newSAXParser.invoke(factory, null);
+            Method newSAXParser = factoryClass.getMethod("newSAXParser", (Class[])null);
+            Object jaxpParser   = newSAXParser.invoke(factory, (Object[])null);
 
             // parser = jaxpParser.getXMLReader();
             Class parserClass = jaxpParser.getClass();
             Method getXMLReader =
-                    parserClass.getMethod("getXMLReader", null);
-            parser = (XMLReader)getXMLReader.invoke(jaxpParser, null);
+                    parserClass.getMethod("getXMLReader", (Class[])null);
+            parser = (XMLReader)getXMLReader.invoke(jaxpParser, (Object[])null);
         } catch (ClassNotFoundException e) {
             //e.printStackTrace();
         } catch (InvocationTargetException e) {
diff -Nru a/src/java/org/jdom/Parent.java b/src/java/org/jdom/Parent.java
--- a/src/java/org/jdom/Parent.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/Parent.java	1970-01-01 00:00:00.000000000 +0100
@@ -105,7 +105,7 @@
      *
      * @return list of cloned child content
      */
-    List cloneContent();
+    List<Content> cloneContent();
 
     /**
      * Returns the child at the given index.
@@ -135,7 +135,7 @@
      * @throws IllegalStateException if parent is a Document
      *         and the root element is not set
      */
-    List getContent();
+    List<Content> getContent();
 
     /**
      * Returns as a {@link java.util.List} the content of
diff -Nru a/src/java/org/jdom/ProcessingInstruction.java b/src/java/org/jdom/ProcessingInstruction.java
--- a/src/java/org/jdom/ProcessingInstruction.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/ProcessingInstruction.java	1970-01-01 00:00:00.000000000 +0100
@@ -72,7 +72,12 @@
 
 public class ProcessingInstruction extends Content {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3978701809428934711L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: ProcessingInstruction.java,v $ $Revision: 1.46 $ $Date: 2004/02/27 11:32:57 $ $Name: jdom_1_0 $";
 
     /** The target of the PI */
@@ -82,7 +87,7 @@
     protected String rawData;
 
     /** The data for the PI in name/value pairs */
-    protected Map mapData;
+    protected Map<String, String> mapData;
 
     /**
      * Default, no-args constructor for implementations
@@ -100,7 +105,7 @@
      * @throws IllegalTargetException if the given target is illegal
      *         as a processing instruction name.
      */
-    public ProcessingInstruction(String target, Map data) {
+    public ProcessingInstruction(String target, Map<String, String> data) {
         setTarget(target);
         setData(data);
     }
@@ -174,7 +179,7 @@
      */
     public List getPseudoAttributeNames() {
       Set mapDataSet = mapData.entrySet();
-      List nameList = new ArrayList();
+      List<String> nameList = new ArrayList<String>();
       for (Iterator i = mapDataSet.iterator(); i.hasNext();) {
          String wholeSet = (i.next()).toString();
          String attrName = wholeSet.substring(0,(wholeSet.indexOf("=")));
@@ -209,7 +214,7 @@
      * @param data new map data to use
      * @return <code>ProcessingInstruction</code> - modified PI.
      */
-    public ProcessingInstruction setData(Map data) {
+    public ProcessingInstruction setData(Map<String, String> data) {
         String temp = toString(data);
 
         String reason = Verifier.checkProcessingInstructionData(temp);
@@ -308,7 +313,7 @@
      * This will parse and load the instructions for the PI.
      * This is separated to allow it to occur once and then be reused.
      */
-    private Map parseData(String rawData) {
+    private Map<String, String> 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:
@@ -320,7 +325,7 @@
         //   <?pi id=22?>                       Empty Map
         //   <?pi id='22?>                      Empty Map
 
-        Map data = new HashMap();
+        Map<String, String> data = new HashMap<String, String>();
 
         // System.out.println("rawData: " + rawData);
 
@@ -347,7 +352,7 @@
                                      inputData.substring(pos+1));
                     // A null value means a parse error and we return empty!
                     if (bounds == null) {
-                        return new HashMap();
+                        return new HashMap<String, String>();
                     }
                     value = inputData.substring(bounds[0]+pos+1,
                                                 bounds[1]+pos+1);
@@ -458,7 +463,7 @@
      * @return <code>Object</code> - clone of this
      * <code>ProcessingInstruction</code>.
      */
-    public Object clone() {
+    public ProcessingInstruction clone() {
         ProcessingInstruction pi = (ProcessingInstruction) super.clone();
 
         // target and rawdata are immutable and references copied by
diff -Nru a/src/java/org/jdom/Text.java b/src/java/org/jdom/Text.java
--- a/src/java/org/jdom/Text.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/Text.java	1970-01-01 00:00:00.000000000 +0100
@@ -68,7 +68,12 @@
  */
 public class Text extends Content {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3544672862851051570L;
+
+	private static final String CVS_ID =
       "@(#) $RCSfile: Text.java,v $ $Revision: 1.24 $ $Date: 2004/02/27 11:32:57 $ $Name: jdom_1_0 $";
 
     static final String EMPTY_STRING = "";
@@ -262,7 +267,7 @@
      *
      * @return <code>Text</code> - cloned node.
      */
-    public Object clone() {
+    public Text clone() {
         Text text = (Text)super.clone();
         text.value = value;
         return text;
diff -Nru a/src/java/org/jdom/transform/JDOMResult.java b/src/java/org/jdom/transform/JDOMResult.java
--- a/src/java/org/jdom/transform/JDOMResult.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/transform/JDOMResult.java	1970-01-01 00:00:00.000000000 +0100
@@ -182,23 +182,23 @@
    * @return the transformation result as a (possibly empty) list of
    *         JDOM nodes (Elements, Texts, Comments, PIs...).
    */
-  public List getResult() {
-    List nodes = Collections.EMPTY_LIST;
+  public List<Content> getResult() {
+    List<Content> nodes = Collections.emptyList();
 
     // Retrieve result from the document builder if not set.
     this.retrieveResult();
 
     if (result instanceof List) {
-      nodes = (List)result;
+      nodes = (List<Content>)result;
     }
     else {
       if ((result instanceof Document) && (queried == false)) {
-        List content = ((Document)result).getContent();
-        nodes = new ArrayList(content.size());
+        List<Content> content = ((Document)result).getContent();
+        nodes = new ArrayList<Content>(content.size());
 
         while (content.size() != 0)
         {
-          Object o = content.remove(0);
+          Content o = content.remove(0);
           nodes.add(o);
         }
         result = nodes;
@@ -392,12 +392,12 @@
      *         their parent.
      */
     private List getDetachedContent(Element elt) {
-      List content = elt.getContent();
-      List nodes   = new ArrayList(content.size());
+      List<Content> content = elt.getContent();
+      List<Content> nodes   = new ArrayList<Content>(content.size());
 
       while (content.size() != 0)
       {
-        Object o = content.remove(0);
+        Content o = content.remove(0);
         nodes.add(o);
       }
       return (nodes);
diff -Nru a/src/java/org/jdom/transform/JDOMSource.java b/src/java/org/jdom/transform/JDOMSource.java
--- a/src/java/org/jdom/transform/JDOMSource.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/transform/JDOMSource.java	1970-01-01 00:00:00.000000000 +0100
@@ -161,7 +161,7 @@
    *                                    <code>null</code>.
    */
   public JDOMSource(Element source) {
-    List nodes = new ArrayList();
+    List<Content> nodes = new ArrayList<Content>();
     nodes.add(source);
 
     setNodes(nodes);
diff -Nru a/src/java/org/jdom/transform/XSLTransformException.java b/src/java/org/jdom/transform/XSLTransformException.java
--- a/src/java/org/jdom/transform/XSLTransformException.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/transform/XSLTransformException.java	1970-01-01 00:00:00.000000000 +0100
@@ -66,7 +66,11 @@
  */
 public class XSLTransformException extends JDOMException {
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3257564014279210296L;
+	private static final String CVS_ID =
             "@(#) $RCSfile: XSLTransformException.java,v $ $Revision: 1.3 $ $Date: 2004/02/06 09:28:32 $ $Name: jdom_1_0 $";
 
     public XSLTransformException() {
diff -Nru a/src/java/org/jdom/UncheckedJDOMFactory.java b/src/java/org/jdom/UncheckedJDOMFactory.java
--- a/src/java/org/jdom/UncheckedJDOMFactory.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/UncheckedJDOMFactory.java	1970-01-01 00:00:00.000000000 +0100
@@ -118,7 +118,7 @@
     // Processing Instruction Factory
     // =====================================================================
 
-    public ProcessingInstruction processingInstruction(String target, Map data) {
+    public ProcessingInstruction processingInstruction(String target, Map<String, String> data) {
         ProcessingInstruction p = new ProcessingInstruction();
         p.target = target;
         p.setData(data);
@@ -224,7 +224,7 @@
 
     public void addNamespaceDeclaration(Element parent, Namespace additional) {
         if (parent.additionalNamespaces == null) {
-            parent.additionalNamespaces = new ArrayList(5); //Element.INITIAL_ARRAY_SIZE
+            parent.additionalNamespaces = new ArrayList<Namespace>(5); //Element.INITIAL_ARRAY_SIZE
         }
         parent.additionalNamespaces.add(additional);
     }
diff -Nru a/src/java/org/jdom/xpath/JaxenXPath.java b/src/java/org/jdom/xpath/JaxenXPath.java
--- a/src/java/org/jdom/xpath/JaxenXPath.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/xpath/JaxenXPath.java	1970-01-01 00:00:00.000000000 +0100
@@ -72,7 +72,12 @@
  */
 class JaxenXPath extends    XPath {             // package protected
 
-    private static final String CVS_ID =
+    /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 4121700988890788658L;
+
+	private static final String CVS_ID =
     "@(#) $RCSfile: JaxenXPath.java,v $ $Revision: 1.19 $ $Date: 2004/09/03 07:27:39 $ $Name: jdom_1_0 $";
 
    /**
@@ -306,7 +311,12 @@
    }
 
    private class NSContext extends SimpleNamespaceContext {
-      public NSContext() {
+      /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3256440300628030515L;
+
+	public NSContext() {
          super();
       }
 
diff -Nru a/src/java/org/jdom/xpath/XPath.java b/src/java/org/jdom/xpath/XPath.java
--- a/src/java/org/jdom/xpath/XPath.java	1970-01-01 00:00:00.000000000 +0100
+++ b/src/java/org/jdom/xpath/XPath.java	1970-01-01 00:00:00.000000000 +0100
@@ -404,6 +404,10 @@
     */
    private final static class XPathString implements Serializable {
       /**
+	 * Comment for <code>serialVersionUID</code>
+	 */
+	private static final long serialVersionUID = 3906928984624411699L;
+	/**
        * The XPath expression as a string.
        */
       private String xPath = null;


More information about the jdom-interest mailing list