diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-06-22 21:21:08 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-06-22 21:21:08 +0000 |
commit | f45d5a527fc7518f35bfbff62eda4efd360b1e88 (patch) | |
tree | 0879d20b4671d8920e788b75db56705fc4328a27 /gnu/xml/xpath/FunctionCall.java | |
parent | 07d83e4a68a79ed4336475f9334222fc9f254668 (diff) | |
download | classpath-f45d5a527fc7518f35bfbff62eda4efd360b1e88.tar.gz |
More generification fixes.
2008-06-22 Andrew John Hughes <gnu_andrew@member.fsf.org>
* gnu/xml/xpath/Expr.java,
* gnu/xml/xpath/FloorFunction.java,
* gnu/xml/xpath/Function.java,
* gnu/xml/xpath/FunctionCall.java,
* gnu/xml/xpath/NamespaceUriFunction.java,
* gnu/xml/xpath/ParenthesizedExpr.java,
* gnu/xml/xpath/Root.java,
* gnu/xml/xpath/Selector.java,
* gnu/xml/xpath/Steps.java:
Genericised.
Diffstat (limited to 'gnu/xml/xpath/FunctionCall.java')
-rw-r--r-- | gnu/xml/xpath/FunctionCall.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gnu/xml/xpath/FunctionCall.java b/gnu/xml/xpath/FunctionCall.java index 70a436f6c..e811f53a2 100644 --- a/gnu/xml/xpath/FunctionCall.java +++ b/gnu/xml/xpath/FunctionCall.java @@ -60,20 +60,24 @@ public final class FunctionCall final XPathFunctionResolver resolver; final String name; - final List args; + final List<Expr> args; public FunctionCall(XPathFunctionResolver resolver, String name) { - this(resolver, name, Collections.EMPTY_LIST); + this(resolver, name, null); } - public FunctionCall(XPathFunctionResolver resolver, String name, List args) + public FunctionCall(XPathFunctionResolver resolver, String name, List<Expr> args) { this.resolver = resolver; this.name = name; - this.args = args; + if (args == null) + this.args = Collections.emptyList(); + else + this.args = args; } + @Override public Object evaluate(Node context, int pos, int len) { if (resolver != null) @@ -94,7 +98,7 @@ public final class FunctionCall } else { - List values = new ArrayList(arity); + List<Object> values = new ArrayList<Object>(arity); for (int i = 0; i < arity; i++) { Expr arg = (Expr) args.get(i); @@ -119,10 +123,10 @@ public final class FunctionCall 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)); } XPathFunctionResolver r = resolver; if (context instanceof XPathFunctionResolver) @@ -134,9 +138,9 @@ public final class FunctionCall 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; } |