villard 2003/07/01 18:58:25
Modified: java/xpath_rwapi/src2/org/apache/xpath/impl Tag: xslt20
OperatorImpl.java FunctionCallImpl.java
ExprImpl.java
Log:
Implements cloneExpression for FunctionCallImpl
Revision Changes Path
No revision
No revision
1.1.2.6 +2 -3
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/OperatorImpl.java
Index: OperatorImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/OperatorImpl.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- OperatorImpl.java 24 Jun 2003 21:09:07 -0000 1.1.2.5
+++ OperatorImpl.java 2 Jul 2003 01:58:24 -0000 1.1.2.6
@@ -193,9 +193,7 @@
}
/**
- * Constructor for cloning
- *
- * @param expr DOCUMENT ME!
+ * Create a clone
*/
protected OperatorImpl(OperatorImpl expr)
{
@@ -206,6 +204,7 @@
m_children = expr.cloneChildren();
}
+
/**
* Constructor for OperatorImpl.
1.1.2.6 +18 -0
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/FunctionCallImpl.java
Index: FunctionCallImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/FunctionCallImpl.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- FunctionCallImpl.java 31 Mar 2003 23:05:52 -0000 1.1.2.5
+++ FunctionCallImpl.java 2 Jul 2003 01:58:24 -0000 1.1.2.6
@@ -75,6 +75,8 @@
*/
QName m_qname;
+ // Constructors
+
/**
* Constructor for FunctionCallImpl.
* @param i
@@ -93,6 +95,18 @@
}
/**
+ * Clone FunctionCall
+ */
+ private FunctionCallImpl(FunctionCallImpl original)
+ {
+ super(original);
+
+ m_qname = original.m_qname;
+ }
+
+ // Implements FunctionCall
+
+ /**
* @see org.apache.xpath.expression.FunctionCall#getFunctionName()
*/
public QName getFunctionQName() {
@@ -167,6 +181,10 @@
*/
public short getOperatorType() {
return COMMA;
+ }
+
+ public Expr cloneExpression() {
+ return new FunctionCallImpl(this);
}
}
1.1.2.5 +17 -10
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/ExprImpl.java
Index: ExprImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/ExprImpl.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- ExprImpl.java 24 Jun 2003 21:09:07 -0000 1.1.2.4
+++ ExprImpl.java 2 Jul 2003 01:58:24 -0000 1.1.2.5
@@ -132,18 +132,25 @@
*/
protected Node[] cloneChildren()
{
- Node[] clone = new Node[m_children.length];
+ Node[] clone;
+ if (m_children != null)
+ {
+ clone = new Node[m_children.length];
- for (int i = 0; i < m_children.length; i++)
- {
- Node child = m_children[i];
- if (child instanceof Expr) {
- clone[i] = (Node) ((Expr) child).cloneExpression();
- } else {
- // immutable object, just copy reference
- clone[i] = child;
+ for (int i = 0; i < m_children.length; i++)
+ {
+ Node child = m_children[i];
+ if (child instanceof Expr) {
+ clone[i] = (Node) ((Expr) child).cloneExpression();
+ } else {
+ // immutable object, just copy reference
+ clone[i] = child;
+ }
}
- }
+ } else
+ {
+ clone = null;
+ }
return clone;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]