This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to annotated tag jaxp-ri-1_2_0-beta-b2
in repository https://gitbox.apache.org/repos/asf/xalan-java.git

commit 550aaee6977caecb89a24032a0c90e4c1bdc43e2
Author: No Author <[email protected]>
AuthorDate: Fri Mar 1 21:46:16 2002 +0000

    This commit was manufactured by cvs2svn to create tag
    'jaxp-ri-1_2_0-beta-b2'.
---
 build.xml                                             | 11 +++++++++--
 .../apache/xalan/xsltc/runtime/TransletLoader.java    | 19 ++++++++++++-------
 src/org/apache/xalan/xsltc/trax/SAX2DOM.java          |  5 +----
 src/org/apache/xalan/xsltc/trax/TemplatesImpl.java    | 10 ++++++++--
 src/trax/trax.properties                              | 11 -----------
 5 files changed, 30 insertions(+), 26 deletions(-)

diff --git a/build.xml b/build.xml
index df7e608..ba937f2 100644
--- a/build.xml
+++ b/build.xml
@@ -78,6 +78,9 @@ Copyright:
   <property name="jlex.jar" value="${bin.dir}/${jlex.jar.name}"/>
   <property name="runtime.jar.name" value="runtime.jar"/>
   <property name="runtime.jar" value="${bin.dir}/${runtime.jar.name}"/>
+  <property name="regexp.jar.name" value="regexp.jar"/>
+  <property name="regexp.jar" value="${bin.dir}/${regexp.jar.name}"/>
+
 
   <!-- Defines general variables used by the other targets; name controls 
output xalan.jar  -->
   <property name="version.VERSION" value="2"/>
@@ -359,7 +362,7 @@ Copyright:
     </javac>
   </target>
 
-  <target name="xsltc.jar" depends="xsltc.compile"
+  <target name="xsltc.unbundledjar" depends="xsltc.compile"
     description="Jar just the xsltc.jar file" >
     <!-- Copy over the manifest, with filtering (for version number) -->
     <filter token="impl.version" value="${impl.version}"/>
@@ -372,7 +375,7 @@ Copyright:
   </target>
 
 
-  <target name="xsltc.bundledjar" depends="xsltc.compile"
+  <target name="xsltc.jar" depends="xsltc.compile"
      description="Jar xsltc, BCEL,JLex,java_cup,runtime and jakarta regexp">
     <!-- make a tmp directory to work in -->
     <delete dir="${build.dir}/xsltctmp" includeEmptyDirs="true" quiet="true"/>
@@ -447,11 +450,14 @@ Copyright:
         includeEmptyDirs="true" quiet="true"/>
 
     <!-- create new META-INF dir w/ transformer factory default -->
+   <!-- GTM: comment this out so that bundled xsltc.jar does not have
+         service provider default until further notice 2/20/2002
     <mkdir dir="${build.dir}/xsltctmp/META-INF"/>
     <mkdir dir="${build.dir}/xsltctmp/META-INF/services"/>
     <copy todir="${build.dir}/xsltctmp/META-INF/services"
       file="${src.dir}/${xsltc.reldir}/javax.xml.transform.TransformerFactory"
     />
+    -->
 
     <!-- Copy over the manifest, with filtering (for version number) -->
     <filter token="impl.version" value="${impl.version}"/>
@@ -845,6 +851,7 @@ Copyright:
       <include name="${dist.file}/bin/${java_cup.jar.name}"/>
       <include name="${dist.file}/bin/${jlex.jar.name}"/>
       <include name="${dist.file}/bin/${runtime.jar.name}"/>
+      <include name="${dist.file}/bin/${regexp.jar.name}"/>
     </patternset>
 
     <tar tarfile="${build.dir}/${dist.file}-bin.tar" >
diff --git a/src/org/apache/xalan/xsltc/runtime/TransletLoader.java 
b/src/org/apache/xalan/xsltc/runtime/TransletLoader.java
index 1974afa..faa8861 100644
--- a/src/org/apache/xalan/xsltc/runtime/TransletLoader.java
+++ b/src/org/apache/xalan/xsltc/runtime/TransletLoader.java
@@ -57,6 +57,7 @@
  * <http://www.apache.org/>.
  *
  * @author Morten Jorgensen
+ * @author Santiago Pericas-Geertsen
  *
  */
 
@@ -64,6 +65,9 @@ package org.apache.xalan.xsltc.runtime;
 
 import java.lang.Class;
 import java.lang.ClassLoader;
+import java.lang.Thread;
+
+import java.net.*;     // temporary
 
 /**
  * This class is intended used when the default Class.forName() method fails.
@@ -91,14 +95,14 @@ final public class TransletLoader {
      * Get a handle to the system class loader
      */
     public TransletLoader() {
-       // Get the default class loader
-       ClassLoader loader = this.getClass().getClassLoader();
-       // If this is the extensions class loader we need to get the
-       // default system class loader instead. This is permitted if
-       // this class was loaded by the extensions class loader.
-       String loaderName = loader.getClass().getName();
-       if (loaderName.equals("sun.misc.Launcher$ExtClassLoader"))
+       // Get the loader for the current thread (not the current class)
+       ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+       // Avoid using the extensions class loader (see comment above)
+       final String loaderName = loader.getClass().getName();
+       if (loaderName.equals("sun.misc.Launcher$ExtClassLoader")) {
            loader = ClassLoader.getSystemClassLoader();
+       }
        _loader = loader;
     }
 
@@ -108,6 +112,7 @@ final public class TransletLoader {
     public Class loadClass(String name) throws ClassNotFoundException {
        return(Class.forName(name, false, _loader));
     }
+
     /**
      * Loads a Class definition and runs static initializers.
      */
diff --git a/src/org/apache/xalan/xsltc/trax/SAX2DOM.java 
b/src/org/apache/xalan/xsltc/trax/SAX2DOM.java
index 82177b7..8dd4616 100644
--- a/src/org/apache/xalan/xsltc/trax/SAX2DOM.java
+++ b/src/org/apache/xalan/xsltc/trax/SAX2DOM.java
@@ -57,7 +57,6 @@
  * <http://www.apache.org/>.
  *
  * @author G. Todd Miller 
- *
  */
 
 
@@ -102,9 +101,7 @@ class SAX2DOM implements ContentHandler {
 
     public void startDocument() {
        _document = _builder.newDocument();
-       Element root = (Element)_document.createElement("root");
-       _document.appendChild(root);
-       _nodeStk.push(root);
+       // bugfix 6417, contributed by Tim Elcott
     }
 
     public void endDocument() {
diff --git a/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java 
b/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
index e1c099c..26cde36 100644
--- a/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
+++ b/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
@@ -59,6 +59,7 @@
  * @author Morten Jorgensen
  * @author G. Todd Millerj
  * @author Jochen Cordes <[email protected]>
+ * @author Santiago Pericas-Geertsen 
  *
  */
 
@@ -176,8 +177,13 @@ public final class TemplatesImpl implements Templates, 
Serializable {
            (TransletClassLoader) AccessController.doPrivileged(
                new PrivilegedAction() {
                        public Object run() {
-                           ClassLoader current = getClass().getClassLoader();
-                           return new TransletClassLoader(current);
+                           /* 
+                            * Get the loader from the current thread instead of
+                            * the class. This is important for translets that 
load
+                            * external Java classes and run in multi-threaded 
envs.
+                            */
+                           return new TransletClassLoader(
+                               Thread.currentThread().getContextClassLoader());
                        }
                    }
                );
diff --git a/src/trax/trax.properties b/src/trax/trax.properties
deleted file mode 100644
index e593c39..0000000
--- a/src/trax/trax.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# $Revision$ $Date$
-#
-# Note: This properties file is provided for illustrative purposes
-#       only and is not part of the interface definition.
-#       This properties file is located in the implementation JAR
-#       and different implementations will specify different
-#       implementation classes and output methods.
-#
-
-# The TRaX Stylesheet processor
-trax.processor.xslt=org.apache.xalan.processor.StylesheetProcessor


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to