sboag 01/06/24 14:54:49
Modified: java/src/org/apache/xpath/axes LocPathIterator.java
PredicatedNodeTest.java UnionPathIterator.java
Log:
These checkins fix http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2005.
Null-pointer in XPath with serialized Templates (
org.apache.xalan.templates.StylesheetRoot ).
At least they fix things enough to pass Shane's tests. There may
be more to come...
Revision Changes Path
1.29 +23 -1 xml-xalan/java/src/org/apache/xpath/axes/LocPathIterator.java
Index: LocPathIterator.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/LocPathIterator.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- LocPathIterator.java 2001/06/23 03:54:30 1.28
+++ LocPathIterator.java 2001/06/24 21:54:49 1.29
@@ -154,6 +154,28 @@
}
/**
+ * Read the object from a serialization stream.
+ *
+ * @param stream Input stream to read from
+ *
+ * @throws java.io.IOException
+ * @throws javax.xml.transform.TransformerException
+ */
+ private void readObject(java.io.ObjectInputStream stream)
+ throws java.io.IOException, javax.xml.transform.TransformerException
+ {
+ try
+ {
+ stream.defaultReadObject();
+ m_clones = new IteratorPool(this);
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ throw new javax.xml.transform.TransformerException(cnfe);
+ }
+ }
+
+ /**
* Set the environment in which this iterator operates, which should provide:
* a node (the context node... same value as "root" defined below)
* a pair of non-zero positive integers (the context position and the context
size)
@@ -962,7 +984,7 @@
* because the hold running state, and thus the original iterator
* expression from the stylesheet pool can not be used.
*/
- protected IteratorPool m_clones = new IteratorPool(this);
+ transient protected IteratorPool m_clones = new IteratorPool(this);
/**
* The dtm of the context node. Careful about using this... it may not
1.6 +25 -1 xml-xalan/java/src/org/apache/xpath/axes/PredicatedNodeTest.java
Index: PredicatedNodeTest.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/PredicatedNodeTest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PredicatedNodeTest.java 2001/06/17 21:41:41 1.5
+++ PredicatedNodeTest.java 2001/06/24 21:54:49 1.6
@@ -37,6 +37,29 @@
}
/**
+ * Read the object from a serialization stream.
+ *
+ * @param stream Input stream to read from
+ *
+ * @throws java.io.IOException
+ * @throws javax.xml.transform.TransformerException
+ */
+ private void readObject(java.io.ObjectInputStream stream)
+ throws java.io.IOException, javax.xml.transform.TransformerException
+ {
+ try
+ {
+ stream.defaultReadObject();
+ m_predicateIndex = -1;
+ resetProximityPositions();
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ throw new javax.xml.transform.TransformerException(cnfe);
+ }
+ }
+
+ /**
* Get a cloned PrdicatedNodeTest.
*
* @return A new PredicatedNodeTest that can be used without mutating this one.
@@ -473,7 +496,8 @@
/** The list of predicate expressions. Is static and does not need
* to be deep cloned.
- * @serial */
+ * @serial
+ */
private Expression[] m_predicates;
/**
1.21 +23 -1 xml-xalan/java/src/org/apache/xpath/axes/UnionPathIterator.java
Index: UnionPathIterator.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/UnionPathIterator.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- UnionPathIterator.java 2001/06/23 03:54:30 1.20
+++ UnionPathIterator.java 2001/06/24 21:54:49 1.21
@@ -195,7 +195,7 @@
}
/** Pool of UnionPathIterators. (The need for this has to be re-evaluated. -sb)
*/
- protected IteratorPool m_clones = new IteratorPool(this);
+ transient protected IteratorPool m_clones = new IteratorPool(this);
/**
* Execute this iterator, meaning create a clone that can
@@ -417,6 +417,28 @@
opPos = compiler.getFirstChildPos(opPos);
loadLocationPaths(compiler, opPos, 0);
+ }
+
+ /**
+ * Read the object from a serialization stream.
+ *
+ * @param stream Input stream to read from
+ *
+ * @throws java.io.IOException
+ * @throws javax.xml.transform.TransformerException
+ */
+ private void readObject(java.io.ObjectInputStream stream)
+ throws java.io.IOException, javax.xml.transform.TransformerException
+ {
+ try
+ {
+ stream.defaultReadObject();
+ m_clones = new IteratorPool(this);
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ throw new javax.xml.transform.TransformerException(cnfe);
+ }
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]