jkesselm 00/10/05 12:09:40
Modified: java/src/org/apache/xalan/processor CompiledTemplate.java
CompilingStylesheetHandler.java
Log:
Make sure we're using .cs.JavaUtils, not .bsf.JavaUtils (claim was made that
wrong one was checked in)
Revision Changes Path
1.3 +24 -9
xml-xalan/java/src/org/apache/xalan/processor/CompiledTemplate.java
Index: CompiledTemplate.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/CompiledTemplate.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CompiledTemplate.java 2000/10/05 16:21:16 1.2
+++ CompiledTemplate.java 2000/10/05 19:09:28 1.3
@@ -1,15 +1,20 @@
-/** Abstract superclass for generated template classes
- (It had been a template, but I want to factor out some "boilerplate" code)
+/** Abstract superclass for generated template classes produced
+ * by the CompilingStylesheetProcessor/CompilingStylesheetHandler.
+ * (This had been an interface, but I want to factor out some
+ * "boilerplate" code rather than regenerating it each time.)
*/
package org.apache.xalan.processor;
import org.apache.xalan.templates.ElemTemplate;
public abstract class CompiledTemplate
extends ElemTemplate
+implements java.io.Serializable
{
- // Object[] m_interpretArray is used to
- // bind to nodes we don't yet know how to compile.
- // Set at construction. ElemTemplateElements and AVTs...
+ // Object[] m_interpretArray is used to bind to nodes we don't yet
+ // know how to compile. Set at construction.
+ // This array resembles the DOM's getChildren().item(), but includes
+ // some things that aren't children, and is our primary access
+ // point for its contents even when they are kids.
protected java.lang.Object[] m_interpretArray;
// Namespace context tracking. Note that this is dynamic state
@@ -18,9 +23,8 @@
// be set in execute() but testable in getNamespaceForPrefix --
// and the latter, most unfortunately, is not passed the xctxt so
// making that threadsafe is a bit ugly.
- protected java.util.Hashtable m_nsThreadContexts=new java.util.Hashtable();
+ transient protected java.util.Hashtable m_nsThreadContexts=new
java.util.Hashtable();
-
/** Accessor to let interpretive children query current namespace state.
* Note that unlike the interpreted version, the namespace state of this
* code changes over time... and that we need to maintain a unique state
@@ -90,8 +94,8 @@
}
}
} // Constructor initialization ends
-
-
+
+
/** Main entry point for the Template transformation.
* It's abstract in CompiledTemplate, but is filled in
* when the actual template code is synthesized.
@@ -101,4 +105,15 @@
org.w3c.dom.Node sourceNode,
org.apache.xalan.utils.QName mode)
throws org.xml.sax.SAXException;
+
+ /** During deserialization, reinstantiate the transient thread-table
+ */
+ private void readObject(java.io.ObjectInputStream in)
+ throws java.io.IOException, ClassNotFoundException
+ {
+ in.defaultReadObject();
+
+ m_nsThreadContexts=new java.util.Hashtable();
+ }
+
}
1.6 +1 -1
xml-xalan/java/src/org/apache/xalan/processor/CompilingStylesheetHandler.java
Index: CompilingStylesheetHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/CompilingStylesheetHandler.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CompilingStylesheetHandler.java 2000/10/05 16:21:17 1.5
+++ CompilingStylesheetHandler.java 2000/10/05 19:09:29 1.6
@@ -95,7 +95,7 @@
import org.xml.sax.SAXParseException;
// Java Compiler support, being swiped from BSF
-// TODO: ADOPT OR ADAPT THIS LOGIC *****
+// TODO: ADOPT OR ADAPT THIS LOGIC, TO REMOVE THIS DEPENDENCY *****
import com.ibm.cs.util.JavaUtils;
/**