[cp-patches] FYI: Generic fixes for gnu.xml.xpath and javax.xml.*

Andrew John Hughes gnu_andrew at member.fsf.org
Sun Jun 22 19:42:21 UTC 2008


This fixes a number of warnings occurring due to the XML
classes not using generics.  The packages in question are
javax.xml.* and gnu.xml.xpath.*.

Note that I couldn't find a copy of Jay to regenerate the
XPath parser so had to manually add changes to both files.
Anyone have any hints on this?

ChangeLog:

2008-06-22  Andrew John Hughes  <gnu_andrew at member.fsf.org>

	* gnu/xml/xpath/BooleanFunction.java,
	* gnu/xml/xpath/CeilingFunction.java,
	* gnu/xml/xpath/ConcatFunction.java,
	* gnu/xml/xpath/DocumentOrderComparator.java,
	* gnu/xml/xpath/Expr.java,
	* gnu/xml/xpath/IdFunction.java,
	* gnu/xml/xpath/LangFunction.java,
	* gnu/xml/xpath/LocalNameFunction.java,
	* gnu/xml/xpath/NameFunction.java,
	* gnu/xml/xpath/NormalizeSpaceFunction.java,
	* gnu/xml/xpath/NotFunction.java,
	* gnu/xml/xpath/NumberFunction.java,
	* gnu/xml/xpath/Path.java,
	* gnu/xml/xpath/RoundFunction.java,
	* gnu/xml/xpath/Selector.java,
	* gnu/xml/xpath/StartsWithFunction.java,
	* gnu/xml/xpath/Steps.java,
	* gnu/xml/xpath/StringFunction.java,
	* gnu/xml/xpath/StringLengthFunction.java,
	* gnu/xml/xpath/SubstringAfterFunction.java,
	* gnu/xml/xpath/SubstringBeforeFunction.java,
	* gnu/xml/xpath/SubstringFunction.java,
	* gnu/xml/xpath/SumFunction.java,
	* gnu/xml/xpath/TranslateFunction.java,
	* gnu/xml/xpath/UnionExpr.java,
	* gnu/xml/xpath/XPathParser.java,
	* gnu/xml/xpath/XPathParser.y,
	* gnu/xml/xpath/XPathTokenizer.java:
	Genericised.
	* javax/xml/datatype/DatatypeFactory.java:
	Use new java.util.ServiceLoader framework.
	* javax/xml/namespace/NamespaceContext.java,
	* javax/xml/parsers/DocumentBuilderFactory.java,
	* javax/xml/parsers/SAXParserFactory.java,
	* javax/xml/stream/XMLEventFactory.java,
	* javax/xml/stream/XMLEventReader.java,
	* javax/xml/stream/XMLInputFactory.java,
	* javax/xml/stream/XMLOutputFactory.java:
	Genericised.
	* javax/xml/stream/events/DTD.java,
	* javax/xml/stream/events/EndElement.java,
	* javax/xml/stream/events/StartElement.java:
	Ignore unchecked errors due to API not using generics.
	* javax/xml/transform/TransformerFactory.java,
	* javax/xml/validation/SchemaFactory.java,
	* javax/xml/xpath/XPathFactory.java:
	Genericised.
	* javax/xml/xpath/XPathFunction.java:
	Ignore unchecked errors due to API not using generics.

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
-------------- next part --------------
Index: gnu/xml/xpath/BooleanFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/BooleanFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 BooleanFunction.java
--- gnu/xml/xpath/BooleanFunction.java	9 Jul 2005 20:38:35 -0000	1.3
+++ gnu/xml/xpath/BooleanFunction.java	22 Jun 2008 19:19:30 -0000
@@ -61,9 +61,9 @@
 
   final Expr arg;
   
-  BooleanFunction(List args)
+  BooleanFunction(List<Expr> args)
   {
-    this((Expr) args.get(0));
+    this(args.get(0));
   }
 
   BooleanFunction(Expr arg)
Index: gnu/xml/xpath/CeilingFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/CeilingFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 CeilingFunction.java
--- gnu/xml/xpath/CeilingFunction.java	9 Jul 2005 20:38:35 -0000	1.3
+++ gnu/xml/xpath/CeilingFunction.java	22 Jun 2008 19:19:30 -0000
@@ -54,9 +54,9 @@
 
   final Expr arg;
   
-  CeilingFunction(List args)
+  CeilingFunction(List<Expr> args)
   {
-    this((Expr) args.get(0));
+    this(args.get(0));
   }
   
   CeilingFunction(Expr arg)
Index: gnu/xml/xpath/ConcatFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/ConcatFunction.java,v
retrieving revision 1.4
diff -u -u -r1.4 ConcatFunction.java
--- gnu/xml/xpath/ConcatFunction.java	28 Apr 2008 19:52:32 -0000	1.4
+++ gnu/xml/xpath/ConcatFunction.java	22 Jun 2008 19:19:30 -0000
@@ -54,19 +54,19 @@
   extends Expr
 {
 
-  final List args;
+  final List<Expr> args;
 
-  ConcatFunction(List args)
+  ConcatFunction(List<Expr> args)
   {
     this.args = args;
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     CPStringBuilder buf = new CPStringBuilder();
-    for (Iterator i = args.iterator(); i.hasNext(); )
+    for (Expr arg : args)
       {
-        Expr arg = (Expr) i.next();
         Object val = arg.evaluate(context, pos, len);
         buf.append(_string(context, val));
       }
@@ -76,19 +76,19 @@
   public Expr clone(Object context)
   {
     int len = args.size();
-    List args2 = new ArrayList(len);
+    List<Expr> args2 = new ArrayList<Expr>(len);
     for (int i = 0; i < len; i++)
       {
-        args2.add(((Expr) args.get(i)).clone(context));
+        args2.add(args.get(i).clone(context));
       }
     return new ConcatFunction(args2);
   }
 
   public boolean references(QName var)
   {
-    for (Iterator i = args.iterator(); i.hasNext(); )
+    for (Iterator<Expr> i = args.iterator(); i.hasNext(); )
       {
-        if (((Expr) i.next()).references(var))
+        if (i.next().references(var))
           {
             return true;
           }
Index: gnu/xml/xpath/DocumentOrderComparator.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/DocumentOrderComparator.java,v
retrieving revision 1.2
diff -u -u -r1.2 DocumentOrderComparator.java
--- gnu/xml/xpath/DocumentOrderComparator.java	2 Jul 2005 20:32:22 -0000	1.2
+++ gnu/xml/xpath/DocumentOrderComparator.java	22 Jun 2008 19:19:30 -0000
@@ -46,18 +46,12 @@
  * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
  */
 public class DocumentOrderComparator
-  implements Comparator
+  implements Comparator<Node>
 {
   
-  public int compare(Object o1, Object o2)
+  public int compare(Node n1, Node n2)
   {
-    if (o1 instanceof Node && o2 instanceof Node)
-      {
-        Node n1 = (Node)o1;
-        Node n2 = (Node)o2;
-        return (int) n1.compareDocumentPosition(n2);
-      }
-    return 0;
+    return (int) n1.compareDocumentPosition(n2);
   }
 
 }
Index: gnu/xml/xpath/Expr.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/Expr.java,v
retrieving revision 1.7
diff -u -u -r1.7 Expr.java
--- gnu/xml/xpath/Expr.java	28 Apr 2008 19:52:32 -0000	1.7
+++ gnu/xml/xpath/Expr.java	22 Jun 2008 19:19:31 -0000
@@ -75,7 +75,7 @@
   implements XPathExpression
 {
 
-  protected static final Comparator documentOrderComparator =
+  protected static final Comparator<Node> documentOrderComparator =
     new DocumentOrderComparator();
 
   protected static final DecimalFormat decimalFormat =
Index: gnu/xml/xpath/IdFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/IdFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 IdFunction.java
--- gnu/xml/xpath/IdFunction.java	9 Jul 2005 20:38:35 -0000	1.3
+++ gnu/xml/xpath/IdFunction.java	22 Jun 2008 19:19:31 -0000
@@ -62,9 +62,9 @@
 
   final Expr arg;
 
-  IdFunction(List args)
+  IdFunction(List<Expr> args)
   {
-    this((Expr) args.get(0));
+    this(args.get(0));
   }
 
   public IdFunction(Expr arg)
@@ -78,6 +78,7 @@
     return !((Collection) ret).isEmpty();
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     Object val = arg.evaluate(context, pos, len);
Index: gnu/xml/xpath/LangFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/LangFunction.java,v
retrieving revision 1.4
diff -u -u -r1.4 LangFunction.java
--- gnu/xml/xpath/LangFunction.java	16 Jan 2006 16:23:20 -0000	1.4
+++ gnu/xml/xpath/LangFunction.java	22 Jun 2008 19:19:31 -0000
@@ -64,9 +64,9 @@
 
   final Expr arg;
 
-  LangFunction(List args)
+  LangFunction(List<Expr> args)
   {
-    this((Expr) args.get(0));
+    this(args.get(0));
   }
 
   LangFunction(Expr arg)
@@ -74,6 +74,7 @@
     this.arg = arg;
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     Object val = arg.evaluate(context, pos, len);
Index: gnu/xml/xpath/LocalNameFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/LocalNameFunction.java,v
retrieving revision 1.4
diff -u -u -r1.4 LocalNameFunction.java
--- gnu/xml/xpath/LocalNameFunction.java	11 Jan 2006 22:05:45 -0000	1.4
+++ gnu/xml/xpath/LocalNameFunction.java	22 Jun 2008 19:19:31 -0000
@@ -59,9 +59,9 @@
 
   final Expr arg;
 
-  LocalNameFunction(List args)
+  LocalNameFunction(List<Expr> args)
   {
-    this(args.size() > 0 ? (Expr) args.get(0) : null);
+    this(args.size() > 0 ? args.get(0) : null);
   }
 
   LocalNameFunction(Expr arg)
@@ -69,6 +69,7 @@
     this.arg = arg;
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     Object val = (arg == null) ? Collections.singleton(context) :
Index: gnu/xml/xpath/NameFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/NameFunction.java,v
retrieving revision 1.4
diff -u -u -r1.4 NameFunction.java
--- gnu/xml/xpath/NameFunction.java	11 Jan 2006 22:05:45 -0000	1.4
+++ gnu/xml/xpath/NameFunction.java	22 Jun 2008 19:19:31 -0000
@@ -67,9 +67,9 @@
 
   final Expr arg;
 
-  NameFunction(List args)
+  NameFunction(List<Expr> args)
   {
-    this(args.size() > 0 ? (Expr) args.get(0) : null);
+    this(args.size() > 0 ? args.get(0) : null);
   }
 
   NameFunction(Expr arg)
@@ -77,6 +77,7 @@
     this.arg = arg;
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     Object val = (arg == null) ? Collections.singleton(context) :
Index: gnu/xml/xpath/NormalizeSpaceFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/NormalizeSpaceFunction.java,v
retrieving revision 1.4
diff -u -u -r1.4 NormalizeSpaceFunction.java
--- gnu/xml/xpath/NormalizeSpaceFunction.java	28 Apr 2008 19:52:33 -0000	1.4
+++ gnu/xml/xpath/NormalizeSpaceFunction.java	22 Jun 2008 19:19:31 -0000
@@ -61,9 +61,9 @@
 
   final Expr arg;
 
-  NormalizeSpaceFunction(List args)
+  NormalizeSpaceFunction(List<Expr> args)
   {
-    this((Expr) args.get(0));
+    this(args.get(0));
   }
   
   NormalizeSpaceFunction(Expr arg)
@@ -71,6 +71,7 @@
     this.arg = arg;
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     Object val = (arg == null) ? null : arg.evaluate(context, pos, len);
Index: gnu/xml/xpath/NotFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/NotFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 NotFunction.java
--- gnu/xml/xpath/NotFunction.java	9 Jul 2005 20:38:36 -0000	1.3
+++ gnu/xml/xpath/NotFunction.java	22 Jun 2008 19:19:31 -0000
@@ -53,9 +53,9 @@
 
   final Expr arg;
 
-  NotFunction(List args)
+  NotFunction(List<Expr> args)
   {
-    this((Expr) args.get(0));
+    this(args.get(0));
   }
 
   NotFunction(Expr arg)
@@ -63,6 +63,7 @@
     this.arg = arg;
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     Object val = arg.evaluate(context, pos, len);
Index: gnu/xml/xpath/NumberFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/NumberFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 NumberFunction.java
--- gnu/xml/xpath/NumberFunction.java	9 Jul 2005 20:38:36 -0000	1.3
+++ gnu/xml/xpath/NumberFunction.java	22 Jun 2008 19:19:31 -0000
@@ -68,9 +68,9 @@
 
   final Expr arg;
 
-  NumberFunction(List args)
+  NumberFunction(List<Expr> args)
   {
-    this(args.size() > 0 ? (Expr) args.get(0) : null);
+    this(args.size() > 0 ? args.get(0) : null);
   }
 
   NumberFunction(Expr arg)
@@ -78,6 +78,7 @@
     this.arg = arg;
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     Object val = (arg == null) ? null : arg.evaluate(context, pos, len);
Index: gnu/xml/xpath/Path.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/Path.java,v
retrieving revision 1.2
diff -u -u -r1.2 Path.java
--- gnu/xml/xpath/Path.java	2 Jul 2005 20:32:22 -0000	1.2
+++ gnu/xml/xpath/Path.java	22 Jun 2008 19:19:31 -0000
@@ -49,6 +49,6 @@
   extends Pattern
 {
 
-  abstract Collection evaluate(Node context, Collection nodeSet);
+  abstract Collection<Node> evaluate(Node context, Collection<Node> nodeSet);
   
 }
Index: gnu/xml/xpath/RoundFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/RoundFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 RoundFunction.java
--- gnu/xml/xpath/RoundFunction.java	9 Jul 2005 20:38:36 -0000	1.3
+++ gnu/xml/xpath/RoundFunction.java	22 Jun 2008 19:19:31 -0000
@@ -60,9 +60,9 @@
 
   final Expr arg;
 
-  RoundFunction(List args)
+  RoundFunction(List<Expr> args)
   {
-    this((Expr) args.get(0));
+    this(args.get(0));
   }
 
   RoundFunction(Expr arg)
@@ -70,6 +70,7 @@
     this.arg = arg;
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     Object val = arg.evaluate(context, pos, len);
Index: gnu/xml/xpath/Selector.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/Selector.java,v
retrieving revision 1.9
diff -u -u -r1.9 Selector.java
--- gnu/xml/xpath/Selector.java	28 Apr 2008 19:52:33 -0000	1.9
+++ gnu/xml/xpath/Selector.java	22 Jun 2008 19:19:31 -0000
@@ -84,7 +84,7 @@
    */
   final Test[] tests;
 
-  public Selector(int axis, List tests)
+  public Selector(int axis, List<? extends Test> tests)
   {
     this.axis = axis;
     int len = tests.size();
@@ -179,29 +179,31 @@
     return count;
   }
 
+
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
-    Set acc = new LinkedHashSet();
+    Set<Node> acc = new LinkedHashSet<Node>();
     addCandidates(context, acc);
-    List candidates = new ArrayList(acc);
-    List ret = filterCandidates(candidates, false);
+    List<Node> candidates = new ArrayList<Node>(acc);
+    List<Node> ret = filterCandidates(candidates, false);
     return ret;
   }
 
-  Collection evaluate(Node context, Collection ns)
+  Collection evaluate(Node context, Collection<Node> ns)
   {
-    Set acc = new LinkedHashSet();
-    for (Iterator i = ns.iterator(); i.hasNext(); )
-      addCandidates((Node) i.next(), acc);
-    List candidates = new ArrayList(acc);
-    List ret = filterCandidates(candidates, true);
+    Set<Node> acc = new LinkedHashSet<Node>();
+    for (Iterator<Node> i = ns.iterator(); i.hasNext(); )
+      addCandidates(i.next(), acc);
+    List<Node> candidates = new ArrayList<Node>(acc);
+    List<Node> ret = filterCandidates(candidates, true);
     return ret;
   }
 
   /**
    * Filter the given list of candidates according to the node tests.
    */
-  List filterCandidates(List candidates, boolean cascade)
+  List<Node> filterCandidates(List<Node> candidates, boolean cascade)
   {
     int len = candidates.size();
     int tlen = tests.length;
@@ -211,10 +213,10 @@
         for (int j = 0; j < tlen && len > 0; j++)
           {
             Test test = tests[j];
-            List successful = new ArrayList(len);
+            List<Node> successful = new ArrayList<Node>(len);
             for (int i = 0; i < len; i++)
               {
-                Node node = (Node) candidates.get(i);
+                Node node = candidates.get(i);
                 if (cascade)
                   {
                     // Documents and DocumentFragments should be considered
@@ -244,7 +246,7 @@
     return candidates;
   }
 
-  void addCandidates(Node context, Collection candidates)
+  void addCandidates(Node context, Collection<Node> candidates)
   {
     // Build list of candidates
     switch (axis)
@@ -293,7 +295,7 @@
       }
   }
 
-  void addChildNodes(Node context, Collection acc, boolean recurse)
+  void addChildNodes(Node context, Collection<Node> acc, boolean recurse)
   {
     Node child = context.getFirstChild();
     while (child != null)
@@ -305,7 +307,7 @@
       }
   }
 
-  void addParentNode(Node context, Collection acc, boolean recurse)
+  void addParentNode(Node context, Collection<Node> acc, boolean recurse)
   {
     Node parent = (context.getNodeType() == Node.ATTRIBUTE_NODE) ?
       ((Attr) context).getOwnerElement() : context.getParentNode();
@@ -317,7 +319,7 @@
       }
   }
 
-  void addFollowingNodes(Node context, Collection acc, boolean recurse)
+  void addFollowingNodes(Node context, Collection<Node> acc, boolean recurse)
   {
     if (context != null && recurse)
       addChildNodes(context, acc, true);
@@ -351,7 +353,7 @@
       }
   }
 
-  void addPrecedingNodes(Node context, Collection acc, boolean recurse)
+  void addPrecedingNodes(Node context, Collection<Node> acc, boolean recurse)
   {
     Node cur = (context.getNodeType() == Node.ATTRIBUTE_NODE) ? null :
       context.getPreviousSibling();
@@ -372,7 +374,7 @@
       }
   }
 
-  void addAttributes(Node context, Collection acc)
+  void addAttributes(Node context, Collection<Node> acc)
   {
     NamedNodeMap attrs = context.getAttributes();
     if (attrs != null)
@@ -389,7 +391,7 @@
       }
   }
 
-  void addNamespaceAttributes(Node context, Collection acc)
+  void addNamespaceAttributes(Node context, Collection<Node> acc)
   {
     NamedNodeMap attrs = context.getAttributes();
     if (attrs != null)
Index: gnu/xml/xpath/StartsWithFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/StartsWithFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 StartsWithFunction.java
--- gnu/xml/xpath/StartsWithFunction.java	9 Jul 2005 20:38:36 -0000	1.3
+++ gnu/xml/xpath/StartsWithFunction.java	22 Jun 2008 19:19:31 -0000
@@ -54,9 +54,9 @@
   final Expr arg1;
   final Expr arg2;
 
-  StartsWithFunction(List args)
+  StartsWithFunction(List<Expr> args)
   {
-    this((Expr) args.get(0), (Expr) args.get(1));
+    this(args.get(0), args.get(1));
   }
 
   StartsWithFunction(Expr arg1, Expr arg2)
Index: gnu/xml/xpath/Steps.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/Steps.java,v
retrieving revision 1.4
diff -u -u -r1.4 Steps.java
--- gnu/xml/xpath/Steps.java	28 Apr 2008 19:52:33 -0000	1.4
+++ gnu/xml/xpath/Steps.java	22 Jun 2008 19:19:31 -0000
@@ -58,14 +58,14 @@
   extends Path
 {
 
-  final LinkedList path;
+  final LinkedList<Expr> path;
 
   public Steps()
   {
-    this(new LinkedList());
+    this(new LinkedList<Expr>());
   }
 
-  Steps(LinkedList path)
+  Steps(LinkedList<Expr> path)
   {
     this.path = path;
   }
@@ -86,10 +86,8 @@
     if (pos > 0)
       {
         Pattern left = (Pattern) path.get(pos - 1);
-        Iterator j = possibleContexts(right, context).iterator();
-        while (j.hasNext())
+	for (Node candidate : possibleContexts(right, context))
           {
-            Node candidate = (Node) j.next();
             if (left.matches(candidate) &&
                 matches(candidate, pos - 1))
               {
@@ -106,12 +104,12 @@
    * Essentially the reverse of Selector.addCandidates.
    * The idea is to determine possible context nodes for a match.
    */
-  Collection possibleContexts(Pattern pattern, Node context)
+  Collection<Node> possibleContexts(Pattern pattern, Node context)
   {
     if (pattern instanceof Selector)
       {
         Selector s = (Selector) pattern;
-        Collection candidates = new LinkedHashSet();
+        Collection<Node> candidates = new LinkedHashSet<Node>();
         switch (s.axis)
           {
           case Selector.PARENT:
@@ -159,15 +157,16 @@
           }
         return candidates;
       }
-    return Collections.EMPTY_SET;
+    return Collections.emptySet();
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     //System.err.println(toString()+" evaluate");
     // Left to right
-    Iterator i = path.iterator();
-    Expr lhs = (Expr) i.next();
+    Iterator<Expr> i = path.iterator();
+    Expr lhs = i.next();
     Object val = lhs.evaluate(context, pos, len);
     //System.err.println("\tevaluate "+lhs+" = "+val);
     while (val instanceof Collection && i.hasNext())
@@ -179,26 +178,26 @@
     return val;
   }
 
-  Collection evaluate(Node context, Collection ns)
+  @Override
+  Collection<Node> evaluate(Node context, Collection<Node> ns)
   {
     // Left to right
-    Iterator i = path.iterator();
-    Expr lhs = (Expr) i.next();
+    Iterator<Expr> i = path.iterator();
+    Expr lhs = i.next();
     if (lhs instanceof Path)
       {
         ns = ((Path) lhs).evaluate(context, ns);
       }
     else
       {
-        Set acc = new LinkedHashSet();
+        Set<Node> acc = new LinkedHashSet<Node>();
         int pos = 1, len = ns.size();
-        for (Iterator j = ns.iterator(); j.hasNext(); )
+	for (Node node : ns)
           {
-            Node node = (Node) j.next();
             Object ret = lhs.evaluate(node, pos++, len);
             if (ret instanceof Collection)
               {
-                acc.addAll((Collection) ret);
+                acc.addAll((Collection<Node>) ret);
               }
           }
         ns = acc;
@@ -214,19 +213,19 @@
   public Expr clone(Object context)
   {
     int len = path.size();
-    LinkedList path2 = new LinkedList();
+    LinkedList<Expr> path2 = new LinkedList<Expr>();
     for (int i = 0; i < len; i++)
       {
-        path2.add(((Expr) path.get(i)).clone(context));
+        path2.add(path.get(i).clone(context));
       }
     return new Steps(path2);
   }
 
   public boolean references(QName var)
   {
-    for (Iterator i = path.iterator(); i.hasNext(); )
+    for (Iterator<Expr> i = path.iterator(); i.hasNext(); )
       {
-        if (((Expr) i.next()).references(var))
+        if (i.next().references(var))
           {
             return true;
           }
@@ -237,15 +236,15 @@
   public String toString()
   {
     CPStringBuilder buf = new CPStringBuilder();
-    Iterator i = path.iterator();
-    Expr expr = (Expr) i.next();
+    Iterator<Expr> i = path.iterator();
+    Expr expr = i.next();
     if (!(expr instanceof Root))
       {
         buf.append(expr);
       }
     while (i.hasNext())
       {
-        expr = (Expr) i.next();
+        expr = i.next();
         buf.append('/');
         buf.append(expr);
       }
Index: gnu/xml/xpath/StringFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/StringFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 StringFunction.java
--- gnu/xml/xpath/StringFunction.java	9 Jul 2005 20:38:36 -0000	1.3
+++ gnu/xml/xpath/StringFunction.java	22 Jun 2008 19:19:31 -0000
@@ -84,9 +84,9 @@
 
   final Expr arg;
 
-  StringFunction(List args)
+  StringFunction(List<Expr> args)
   {
-    this(args.size() > 0 ? (Expr) args.get(0) : null);
+    this(args.size() > 0 ? args.get(0) : null);
   }
   
   StringFunction(Expr arg)
Index: gnu/xml/xpath/StringLengthFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/StringLengthFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 StringLengthFunction.java
--- gnu/xml/xpath/StringLengthFunction.java	9 Jul 2005 20:38:36 -0000	1.3
+++ gnu/xml/xpath/StringLengthFunction.java	22 Jun 2008 19:19:32 -0000
@@ -55,7 +55,7 @@
 
   final Expr arg;
 
-  StringLengthFunction(List args)
+  StringLengthFunction(List<Expr> args)
   {
     this(args.isEmpty() ? null : (Expr) args.get(0));
   }
@@ -65,6 +65,7 @@
     this.arg = arg;
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     Object val = (arg == null) ? null : arg.evaluate(context, pos, len);
Index: gnu/xml/xpath/SubstringAfterFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/SubstringAfterFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 SubstringAfterFunction.java
--- gnu/xml/xpath/SubstringAfterFunction.java	9 Jul 2005 20:38:36 -0000	1.3
+++ gnu/xml/xpath/SubstringAfterFunction.java	22 Jun 2008 19:19:32 -0000
@@ -58,9 +58,9 @@
   final Expr arg1;
   final Expr arg2;
 
-  SubstringAfterFunction(List args)
+  SubstringAfterFunction(List<Expr> args)
   {
-    this((Expr) args.get(0), (Expr) args.get(1));
+    this(args.get(0), args.get(1));
   }
 
   SubstringAfterFunction(Expr arg1, Expr arg2)
Index: gnu/xml/xpath/SubstringBeforeFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/SubstringBeforeFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 SubstringBeforeFunction.java
--- gnu/xml/xpath/SubstringBeforeFunction.java	9 Jul 2005 20:38:36 -0000	1.3
+++ gnu/xml/xpath/SubstringBeforeFunction.java	22 Jun 2008 19:19:32 -0000
@@ -57,9 +57,9 @@
   final Expr arg1;
   final Expr arg2;
 
-  SubstringBeforeFunction(List args)
+  SubstringBeforeFunction(List<Expr> args)
   {
-    this((Expr) args.get(0), (Expr) args.get(1));
+    this(args.get(0), args.get(1));
   }
 
   SubstringBeforeFunction(Expr arg1, Expr arg2)
Index: gnu/xml/xpath/SubstringFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/SubstringFunction.java,v
retrieving revision 1.4
diff -u -u -r1.4 SubstringFunction.java
--- gnu/xml/xpath/SubstringFunction.java	11 Jan 2006 22:05:45 -0000	1.4
+++ gnu/xml/xpath/SubstringFunction.java	22 Jun 2008 19:19:32 -0000
@@ -60,10 +60,10 @@
   final Expr arg2;
   final Expr arg3;
 
-  SubstringFunction(List args)
+  SubstringFunction(List<Expr> args)
   {
-    this((Expr) args.get(0), (Expr) args.get(1),
-         (args.size() > 2) ? (Expr) args.get(2) : null);
+    this(args.get(0), args.get(1),
+         (args.size() > 2) ? args.get(2) : null);
   }
 
   SubstringFunction(Expr arg1, Expr arg2, Expr arg3)
@@ -73,6 +73,7 @@
     this.arg3 = arg3;
   }
 
+  @Override
   public Object evaluate(Node context, int pos, int len)
   {
     Object val1 = arg1.evaluate(context, pos, len);
Index: gnu/xml/xpath/SumFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/SumFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 SumFunction.java
--- gnu/xml/xpath/SumFunction.java	9 Jul 2005 20:38:36 -0000	1.3
+++ gnu/xml/xpath/SumFunction.java	22 Jun 2008 19:19:32 -0000
@@ -56,9 +56,9 @@
 
   final Expr arg;
 
-  SumFunction(List args)
+  SumFunction(List<Expr> args)
   {
-    this((Expr) args.get(0));
+    this(args.get(0));
   }
 
   SumFunction(Expr arg)
@@ -66,15 +66,15 @@
     this.arg = arg;
   }
 
+  @Override @SuppressWarnings("unchecked")
   public Object evaluate(Node context, int pos, int len)
   {
     Object val = arg.evaluate(context, pos, len);
     double sum = 0.0d;
     if (val instanceof Collection)
       {
-        for (Iterator i = ((Collection) val).iterator(); i.hasNext(); )
+	for (Node node : ((Collection<Node>) val))
           {
-            Node node = (Node) i.next();
             String s = stringValue(node);
             sum += _number(context, s);
           }
Index: gnu/xml/xpath/TranslateFunction.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/TranslateFunction.java,v
retrieving revision 1.4
diff -u -u -r1.4 TranslateFunction.java
--- gnu/xml/xpath/TranslateFunction.java	28 Apr 2008 19:52:33 -0000	1.4
+++ gnu/xml/xpath/TranslateFunction.java	22 Jun 2008 19:19:32 -0000
@@ -68,9 +68,9 @@
   final Expr arg2;
   final Expr arg3;
 
-  TranslateFunction(List args)
+  TranslateFunction(List<Expr> args)
   {
-    this((Expr) args.get(0), (Expr) args.get(1), (Expr) args.get(2));
+    this(args.get(0), args.get(1), args.get(2));
   }
 
   TranslateFunction(Expr arg1, Expr arg2, Expr arg3)
Index: gnu/xml/xpath/UnionExpr.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/UnionExpr.java,v
retrieving revision 1.3
diff -u -u -r1.3 UnionExpr.java
--- gnu/xml/xpath/UnionExpr.java	9 Jul 2005 20:38:36 -0000	1.3
+++ gnu/xml/xpath/UnionExpr.java	22 Jun 2008 19:19:32 -0000
@@ -74,16 +74,17 @@
     return false;
   }
 
+  @Override @SuppressWarnings("unchecked")
   public Object evaluate(Node context, int pos, int len)
   {
     Object left = lhs.evaluate(context, pos, len);
     Object right = rhs.evaluate(context, pos, len);
     if (left instanceof Collection && right instanceof Collection)
       {
-        Set set = new HashSet();
-        set.addAll ((Collection) left);
-        set.addAll ((Collection) right);
-        List list = new ArrayList(set);
+        Set<Node> set = new HashSet<Node>();
+	set.addAll ((Collection<Node>) left);
+        set.addAll ((Collection<Node>) right);
+        List<Node> list = new ArrayList<Node>(set);
         Collections.sort(list, documentOrderComparator);
         return list;
       }
Index: gnu/xml/xpath/XPathParser.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/XPathParser.java,v
retrieving revision 1.6
diff -u -u -r1.6 XPathParser.java
--- gnu/xml/xpath/XPathParser.java	18 Sep 2007 21:52:34 -0000	1.6
+++ gnu/xml/xpath/XPathParser.java	22 Jun 2008 19:19:34 -0000
@@ -79,7 +79,7 @@
     return qName;
   }
 
-  Expr lookupFunction(String name, List args)
+  Expr lookupFunction(String name, List<Expr> args)
   {
     int arity = args.size();
     if ("position".equals(name) && arity == 0)
@@ -391,6 +391,7 @@
       @return result of the last reduction, if any.
       @throws yyException on irrecoverable parse error.
     */
+  @SuppressWarnings("unchecked")
   public Object yyparse (yyInput yyLex)
 				throws java.io.IOException, yyException {
     if (yyMax <= 0) yyMax = 256;			// initial size
@@ -491,7 +492,7 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst(yyVals[0+yyTop]);
+          steps.path.addFirst((Expr) yyVals[0+yyTop]);
         }
       steps.path.addFirst(new Root());
       yyVal = steps;
@@ -512,7 +513,7 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst(yyVals[0+yyTop]);
+          steps.path.addFirst((Expr) yyVals[0+yyTop]);
         }
       steps.path.addFirst(s);
       steps.path.addFirst(new Root());
@@ -532,9 +533,9 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst(yyVals[-2+yyTop]);
+          steps.path.addFirst((Expr) yyVals[-2+yyTop]);
         }
-      steps.path.addLast(yyVals[0+yyTop]);
+      steps.path.addLast((Expr) yyVals[0+yyTop]);
       yyVal = steps;
       /*$$ = new Step((Expr) $1, (Path) $3);*/
     }
@@ -553,10 +554,10 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst(yyVals[-2+yyTop]);
+          steps.path.addFirst((Expr) yyVals[-2+yyTop]);
         }
       steps.path.addLast(s);
-      steps.path.addLast(yyVals[0+yyTop]);
+      steps.path.addLast((Expr) yyVals[0+yyTop]);
       yyVal = steps;
       /*Step step = new Step(s, (Path) $3);*/
       /*$$ = new Step((Expr) $1, step);*/
@@ -565,46 +566,48 @@
 case 10:
 					// line 362 "XPathParser.y"
   {
-      yyVal = new Selector (Selector.CHILD, (List) yyVals[0+yyTop]);
+      yyVal = new Selector (Selector.CHILD, (List<Test>) yyVals[0+yyTop]);
     }
   break;
 case 11:
 					// line 366 "XPathParser.y"
   {
-      yyVal = new Selector (Selector.ATTRIBUTE, (List) yyVals[0+yyTop]);
+      yyVal = new Selector (Selector.ATTRIBUTE, (List<Test>) yyVals[0+yyTop]);
     }
   break;
 case 12:
 					// line 370 "XPathParser.y"
   {
-      yyVal = new Selector (((Integer) yyVals[-2+yyTop]).intValue (), (List) yyVals[0+yyTop]);
+      yyVal = new Selector (((Integer) yyVals[-2+yyTop]).intValue (), (List<Test>) yyVals[0+yyTop]);
     }
   break;
 case 13:
 					// line 374 "XPathParser.y"
   {
-      yyVal = new Selector (Selector.SELF, Collections.EMPTY_LIST);
-    }
+    List<Test> emptyList = Collections.emptyList();
+    yyVal = new Selector (Selector.SELF, emptyList);
+  }
   break;
 case 14:
 					// line 378 "XPathParser.y"
   {
-      yyVal = new Selector (Selector.PARENT, Collections.EMPTY_LIST);
-    }
+    List<Test> emptyList = Collections.emptyList();
+    yyVal = new Selector (Selector.PARENT, emptyList);
+  }
   break;
 case 15:
 					// line 385 "XPathParser.y"
   {
-      List list = new ArrayList();
-      list.add(yyVals[0+yyTop]);
+      List<Test> list = new ArrayList<Test>();
+      list.add((Test) yyVals[0+yyTop]);
       yyVal = list;
     }
   break;
 case 16:
 					// line 391 "XPathParser.y"
   {
-      List list = (List)yyVals[-1+yyTop];
-      list.add(yyVals[0+yyTop]);
+      List<Test> list = (List<Test>)yyVals[-1+yyTop];
+      list.add((Test) yyVals[0+yyTop]);
       yyVal = list;
     }
   break;
@@ -725,8 +728,9 @@
 case 39:
 					// line 508 "XPathParser.y"
   {
-      yyVal = lookupFunction((String) yyVals[-2+yyTop], Collections.EMPTY_LIST);
-    }
+    List<Expr> emptyList = Collections.emptyList();
+    yyVal = lookupFunction((String) yyVals[-2+yyTop], emptyList);
+  }
   break;
 case 40:
 					// line 512 "XPathParser.y"
@@ -737,16 +741,16 @@
 case 41:
 					// line 519 "XPathParser.y"
   {
-      List list = new ArrayList();
-      list.add(yyVals[0+yyTop]);
+      List<Expr> list = new ArrayList<Expr>();
+      list.add((Expr) yyVals[0+yyTop]);
       yyVal = list;
     }
   break;
 case 42:
 					// line 525 "XPathParser.y"
   {
-      List list = (List) yyVals[0+yyTop];
-      list.add(0, yyVals[-2+yyTop]);
+      List<Expr> list = (List<Expr>) yyVals[0+yyTop];
+      list.add(0, (Expr) yyVals[-2+yyTop]);
       yyVal = list;
     }
   break;
@@ -767,9 +771,9 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst(yyVals[0+yyTop]);
+          steps.path.addFirst((Expr) yyVals[0+yyTop]);
         }
-      steps.path.addFirst(yyVals[-2+yyTop]);
+      steps.path.addFirst((Expr) yyVals[-2+yyTop]);
       yyVal = steps;
       /*$$ = new Step ((Expr) $1, (Path) $3);*/
     }
@@ -788,10 +792,10 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst(yyVals[0+yyTop]);
+          steps.path.addFirst((Expr) yyVals[0+yyTop]);
         }
       steps.path.addFirst(s);
-      steps.path.addFirst(yyVals[-2+yyTop]);
+      steps.path.addFirst((Expr) yyVals[-2+yyTop]);
       yyVal = steps;
       /*Step step = new Step (s, (Path) $3);*/
       /*$$ = new Step ((Expr) $1, step);*/
@@ -811,7 +815,7 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst(yyVals[-1+yyTop]);
+          steps.path.addFirst((Expr) yyVals[-1+yyTop]);
         }
       steps.path.addLast(s);
       yyVal = steps;
Index: gnu/xml/xpath/XPathParser.y
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/XPathParser.y,v
retrieving revision 1.4
diff -u -u -r1.4 XPathParser.y
--- gnu/xml/xpath/XPathParser.y	25 Aug 2005 12:59:42 -0000	1.4
+++ gnu/xml/xpath/XPathParser.y	22 Jun 2008 19:19:34 -0000
@@ -78,7 +78,7 @@
     return qName;
   }
 
-  Expr lookupFunction(String name, List args)
+  Expr lookupFunction(String name, List<Expr> args)
   {
     int arity = args.size();
     if ("position".equals(name) && arity == 0)
@@ -287,7 +287,7 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst($2);
+          steps.path.addFirst((Expr) $2);
         }
       steps.path.addFirst(new Root());
       $$ = steps;
@@ -306,7 +306,7 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst($2);
+          steps.path.addFirst((Expr) $2);
         }
       steps.path.addFirst(s);
       steps.path.addFirst(new Root());
@@ -328,9 +328,9 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst($1);
+          steps.path.addFirst((Expr) $1);
         }
-      steps.path.addLast($3);
+      steps.path.addLast((Expr) $3);
       $$ = steps;
       //$$ = new Step((Expr) $1, (Path) $3);
     }
@@ -347,10 +347,10 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst($1);
+          steps.path.addFirst((Expr) $1);
         }
       steps.path.addLast(s);
-      steps.path.addLast($3);
+      steps.path.addLast((Expr) $3);
       $$ = steps;
       //Step step = new Step(s, (Path) $3);
       //$$ = new Step((Expr) $1, step);
@@ -372,25 +372,27 @@
     }
   | DOT
     {
-      $$ = new Selector (Selector.SELF, Collections.EMPTY_LIST);
+      List<Test> emptyList = Collections.emptyList();
+      $$ = new Selector (Selector.SELF, emptyList);
     }
   | DOUBLE_DOT
     {
-      $$ = new Selector (Selector.PARENT, Collections.EMPTY_LIST);
+      List<Test> emptyList = Collections.emptyList();
+      $$ = new Selector (Selector.PARENT, emptyList);
     }
   ;
 
 step_node_test:
   node_test
     {
-      List list = new ArrayList();
-      list.add($1);
+      List<Test> list = new ArrayList<Test>();
+      list.add((Test) $1);
       $$ = list;
     }
   | step_node_test predicate
     {
-      List list = (List)$1;
-      list.add($2);
+      List<Test> list = (List<Test>)$1;
+      list.add((Test) $2);
       $$ = list;
     }
   ;
@@ -506,7 +508,7 @@
 function_call:
   function_name LP RP
     {
-      $$ = lookupFunction((String) $1, Collections.EMPTY_LIST);
+      $$ = lookupFunction((String) $1, Collections.emptyList());
     }
   | function_name LP argument_list RP
     {
@@ -517,14 +519,14 @@
 argument_list:
   expr
     {
-      List list = new ArrayList();
-      list.add($1);
+      List<Expr> list = new ArrayList<Expr>();
+      list.add((Expr) $1);
       $$ = list;
     }
   | expr COMMA argument_list
     {
-      List list = (List) $3;
-      list.add(0, $1);
+      List<Expr> list = (List<Expr>) $3;
+      list.add(0, (Expr) $1);
       $$ = list;
     }
   ;
@@ -550,9 +552,9 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst($3);
+          steps.path.addFirst((Expr) $3);
         }
-      steps.path.addFirst($1);
+      steps.path.addFirst((Expr) $1);
       $$ = steps;
       //$$ = new Step ((Expr) $1, (Path) $3);
     }
@@ -572,7 +574,7 @@
           steps.path.addFirst($3);
         }
       steps.path.addFirst(s);
-      steps.path.addFirst($1);
+      steps.path.addFirst((Expr) $1);
       $$ = steps;
       //Step step = new Step (s, (Path) $3);
       //$$ = new Step ((Expr) $1, step);
@@ -594,7 +596,7 @@
       else
         {
           steps = new Steps();
-          steps.path.addFirst($1);
+          steps.path.addFirst((Expr) $1);
         }
       steps.path.addLast(s);
       $$ = steps;
Index: gnu/xml/xpath/XPathTokenizer.java
===================================================================
RCS file: /sources/classpath/classpath/gnu/xml/xpath/XPathTokenizer.java,v
retrieving revision 1.3
diff -u -u -r1.3 XPathTokenizer.java
--- gnu/xml/xpath/XPathTokenizer.java	28 Apr 2008 19:52:33 -0000	1.3
+++ gnu/xml/xpath/XPathTokenizer.java	22 Jun 2008 19:19:36 -0000
@@ -92,7 +92,7 @@
     
   }
 
-  static final Map keywords = new TreeMap ();
+  static final Map<String,Integer> keywords = new TreeMap<String,Integer> ();
   static
   {
     keywords.put ("ancestor", new Integer (XPathParser.ANCESTOR));
Index: javax/xml/datatype/DatatypeFactory.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/datatype/DatatypeFactory.java,v
retrieving revision 1.7
diff -u -u -r1.7 DatatypeFactory.java
--- javax/xml/datatype/DatatypeFactory.java	18 Sep 2007 21:52:36 -0000	1.7
+++ javax/xml/datatype/DatatypeFactory.java	22 Jun 2008 19:19:41 -0000
@@ -44,7 +44,7 @@
 import java.util.GregorianCalendar;
 import java.util.Iterator;
 import java.util.Properties;
-import gnu.classpath.ServiceFactory;
+import java.util.ServiceLoader;
 
 /**
  * Factory class to create new datatype objects mapping XML to and from Java
@@ -97,11 +97,11 @@
               return (DatatypeFactory) Class.forName(className).newInstance();
           }
         // 3. services
-        Iterator i = ServiceFactory.lookupProviders(DatatypeFactory.class);
+        Iterator<DatatypeFactory> i = ServiceLoader.load(DatatypeFactory.class).iterator();
         if (i.hasNext())
-          return (DatatypeFactory) i.next();
+          return i.next();
         // 4. fallback
-        Class t = Class.forName(DATATYPEFACTORY_IMPLEMENTATION_CLASS);
+        Class<?> t = Class.forName(DATATYPEFACTORY_IMPLEMENTATION_CLASS);
         return (DatatypeFactory) t.newInstance();
       }
     catch (Exception e)
Index: javax/xml/namespace/NamespaceContext.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/namespace/NamespaceContext.java,v
retrieving revision 1.3
diff -u -u -r1.3 NamespaceContext.java
--- javax/xml/namespace/NamespaceContext.java	2 Jul 2005 20:32:52 -0000	1.3
+++ javax/xml/namespace/NamespaceContext.java	22 Jun 2008 19:19:41 -0000
@@ -61,6 +61,7 @@
   /**
    * Returns all the prefixes currently bound to the given namespace URI.
    */
+  @SuppressWarnings("unchecked")
   public Iterator getPrefixes(String namespaceURI);
   
 }
Index: javax/xml/parsers/DocumentBuilderFactory.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/parsers/DocumentBuilderFactory.java,v
retrieving revision 1.6
diff -u -u -r1.6 DocumentBuilderFactory.java
--- javax/xml/parsers/DocumentBuilderFactory.java	6 Dec 2006 11:36:42 -0000	1.6
+++ javax/xml/parsers/DocumentBuilderFactory.java	22 Jun 2008 19:19:41 -0000
@@ -99,7 +99,7 @@
           {
             try
               {
-                Class t = (loader != null) ? loader.loadClass(className) :
+                Class<?> t = (loader != null) ? loader.loadClass(className) :
                   Class.forName(className);
                 return (DocumentBuilderFactory) t.newInstance();
               }
Index: javax/xml/parsers/SAXParserFactory.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/parsers/SAXParserFactory.java,v
retrieving revision 1.4
diff -u -u -r1.4 SAXParserFactory.java
--- javax/xml/parsers/SAXParserFactory.java	24 Dec 2005 14:14:48 -0000	1.4
+++ javax/xml/parsers/SAXParserFactory.java	22 Jun 2008 19:19:41 -0000
@@ -99,7 +99,7 @@
           {
             try
               {
-                Class t = (loader != null) ? loader.loadClass(className) :
+                Class<?> t = (loader != null) ? loader.loadClass(className) :
                   Class.forName(className);
                 return (SAXParserFactory) t.newInstance();
               }
Index: javax/xml/stream/XMLEventFactory.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/stream/XMLEventFactory.java,v
retrieving revision 1.5
diff -u -u -r1.5 XMLEventFactory.java
--- javax/xml/stream/XMLEventFactory.java	18 Sep 2007 21:52:37 -0000	1.5
+++ javax/xml/stream/XMLEventFactory.java	22 Jun 2008 19:19:41 -0000
@@ -116,7 +116,7 @@
           {
             try
               {
-                Class t = (loader != null) ? loader.loadClass(className) :
+                Class<?> t = (loader != null) ? loader.loadClass(className) :
                   Class.forName(className);
                 return (XMLEventFactory) t.newInstance();
               }
@@ -217,6 +217,7 @@
   /**
    * Create a start-element event.
    */
+  @SuppressWarnings("unchecked")
   public abstract StartElement createStartElement(QName name,
                                                   Iterator attributes,
                                                   Iterator namespaces);
@@ -231,6 +232,7 @@
   /**
    * Create a start-element event.
    */
+  @SuppressWarnings("unchecked")
   public abstract StartElement createStartElement(String prefix,
                                                   String namespaceUri,
                                                   String localName,
@@ -240,6 +242,7 @@
   /**
    * Create a start-element event.
    */
+  @SuppressWarnings("unchecked")
   public abstract StartElement createStartElement(String prefix,
                                                   String namespaceUri,
                                                   String localName,
@@ -250,6 +253,7 @@
   /**
    * Create an end-element event.
    */
+  @SuppressWarnings("unchecked")
   public abstract EndElement createEndElement(QName name,
                                               Iterator namespaces);
 
@@ -263,6 +267,7 @@
   /**
    * Create an end-element event.
    */
+  @SuppressWarnings("unchecked")
   public abstract EndElement createEndElement(String prefix,
                                               String namespaceUri,
                                               String localName,
Index: javax/xml/stream/XMLEventReader.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/stream/XMLEventReader.java,v
retrieving revision 1.2
diff -u -u -r1.2 XMLEventReader.java
--- javax/xml/stream/XMLEventReader.java	3 Mar 2006 12:30:59 -0000	1.2
+++ javax/xml/stream/XMLEventReader.java	22 Jun 2008 19:19:41 -0000
@@ -43,6 +43,7 @@
 /**
  * An XML parser.
  */
+ at SuppressWarnings("unchecked")
 public interface XMLEventReader
   extends Iterator
 {
Index: javax/xml/stream/XMLInputFactory.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/stream/XMLInputFactory.java,v
retrieving revision 1.5
diff -u -u -r1.5 XMLInputFactory.java
--- javax/xml/stream/XMLInputFactory.java	18 Sep 2007 21:52:37 -0000	1.5
+++ javax/xml/stream/XMLInputFactory.java	22 Jun 2008 19:19:41 -0000
@@ -229,7 +229,7 @@
           {
             try
               {
-                Class t = (loader != null) ? loader.loadClass(className) :
+                Class<?> t = (loader != null) ? loader.loadClass(className) :
                   Class.forName(className);
                 return (XMLInputFactory) t.newInstance();
               }
Index: javax/xml/stream/XMLOutputFactory.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/stream/XMLOutputFactory.java,v
retrieving revision 1.4
diff -u -u -r1.4 XMLOutputFactory.java
--- javax/xml/stream/XMLOutputFactory.java	3 Mar 2006 12:30:59 -0000	1.4
+++ javax/xml/stream/XMLOutputFactory.java	22 Jun 2008 19:19:41 -0000
@@ -116,7 +116,7 @@
           {
             try
               {
-                Class t = (loader != null) ? loader.loadClass(className) :
+                Class<?> t = (loader != null) ? loader.loadClass(className) :
                   Class.forName(className);
                 return (XMLOutputFactory) t.newInstance();
               }
Index: javax/xml/stream/events/DTD.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/stream/events/DTD.java,v
retrieving revision 1.1
diff -u -u -r1.1 DTD.java
--- javax/xml/stream/events/DTD.java	3 Sep 2005 10:04:19 -0000	1.1
+++ javax/xml/stream/events/DTD.java	22 Jun 2008 19:19:41 -0000
@@ -60,11 +60,13 @@
   /**
    * Returns the notations declared in the DTD.
    */
+  @SuppressWarnings("unchecked")
   List getNotations();
 
   /**
    * Returns the entities declared in the DTD.
    */
+  @SuppressWarnings("unchecked")
   List getEntities();
   
 }
Index: javax/xml/stream/events/EndElement.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/stream/events/EndElement.java,v
retrieving revision 1.1
diff -u -u -r1.1 EndElement.java
--- javax/xml/stream/events/EndElement.java	3 Sep 2005 10:04:19 -0000	1.1
+++ javax/xml/stream/events/EndElement.java	22 Jun 2008 19:19:41 -0000
@@ -55,6 +55,7 @@
   /**
    * Returns the namespaces that have gone out of scope.
    */
+  @SuppressWarnings("unchecked")
   Iterator getNamespaces();
   
 }
Index: javax/xml/stream/events/StartElement.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/stream/events/StartElement.java,v
retrieving revision 1.1
diff -u -u -r1.1 StartElement.java
--- javax/xml/stream/events/StartElement.java	3 Sep 2005 10:04:19 -0000	1.1
+++ javax/xml/stream/events/StartElement.java	22 Jun 2008 19:19:43 -0000
@@ -56,11 +56,13 @@
   /**
    * Returns the attributes declared on this element.
    */
+  @SuppressWarnings("unchecked")
   Iterator getAttributes();
 
   /**
    * Returns the namespaces declared on this element.
    */
+  @SuppressWarnings("unchecked")
   Iterator getNamespaces();
 
   /**
Index: javax/xml/transform/TransformerFactory.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/transform/TransformerFactory.java,v
retrieving revision 1.3
diff -u -u -r1.3 TransformerFactory.java
--- javax/xml/transform/TransformerFactory.java	2 Jul 2005 20:32:52 -0000	1.3
+++ javax/xml/transform/TransformerFactory.java	22 Jun 2008 19:19:43 -0000
@@ -89,7 +89,7 @@
           {
             try
               {
-                Class t = (loader != null) ? loader.loadClass(className) :
+                Class<?> t = (loader != null) ? loader.loadClass(className) :
                   Class.forName(className);
                 return (TransformerFactory) t.newInstance();
               }
@@ -107,7 +107,7 @@
     while (className == null && count < 3);
     try
       {
-        Class t =
+        Class<?> t =
           Class.forName("gnu.xml.transform.TransformerFactoryImpl");
         return (TransformerFactory) t.newInstance();
       }
Index: javax/xml/validation/SchemaFactory.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/validation/SchemaFactory.java,v
retrieving revision 1.6
diff -u -u -r1.6 SchemaFactory.java
--- javax/xml/validation/SchemaFactory.java	6 Dec 2006 11:14:24 -0000	1.6
+++ javax/xml/validation/SchemaFactory.java	22 Jun 2008 19:19:43 -0000
@@ -89,7 +89,7 @@
           {
             try
               {
-                Class t = (loader != null) ? loader.loadClass(className) :
+                Class<?> t = (loader != null) ? loader.loadClass(className) :
                     Class.forName(className);
                 return (SchemaFactory) t.newInstance();
               }
@@ -118,7 +118,7 @@
                 for (String line = r.readLine(); line != null;
                         line = r.readLine())
                   {
-                    Class t = (loader != null) ? loader.loadClass(className) :
+                    Class<?> t = (loader != null) ? loader.loadClass(className) :
                         Class.forName(className);
                     SchemaFactory ret = (SchemaFactory) t.newInstance();
                     if (ret.isSchemaLanguageSupported(schemaLanguage))
Index: javax/xml/xpath/XPathFactory.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/xpath/XPathFactory.java,v
retrieving revision 1.3
diff -u -u -r1.3 XPathFactory.java
--- javax/xml/xpath/XPathFactory.java	2 Jul 2005 20:32:52 -0000	1.3
+++ javax/xml/xpath/XPathFactory.java	22 Jun 2008 19:19:43 -0000
@@ -117,7 +117,7 @@
           {
             try
               {
-                Class t = (loader != null) ? loader.loadClass(className) :
+                Class<?> t = (loader != null) ? loader.loadClass(className) :
                   Class.forName(className);
                 XPathFactory ret = (XPathFactory) t.newInstance();
                 if (ret.isObjectModelSupported(uri))
Index: javax/xml/xpath/XPathFunction.java
===================================================================
RCS file: /sources/classpath/classpath/javax/xml/xpath/XPathFunction.java,v
retrieving revision 1.3
diff -u -u -r1.3 XPathFunction.java
--- javax/xml/xpath/XPathFunction.java	2 Jul 2005 20:32:52 -0000	1.3
+++ javax/xml/xpath/XPathFunction.java	22 Jun 2008 19:19:43 -0000
@@ -52,6 +52,7 @@
    * Evaluate the function with the specified arguments.
    * @param args the list of arguments
    */
+  @SuppressWarnings("unchecked")
   Object evaluate(List args)
     throws XPathFunctionException;
   


More information about the Classpath-patches mailing list