Skip to content

Commit

Permalink
This commit was manufactured by cvs2svn to create tag
Browse files Browse the repository at this point in the history
'jaxp-ri-1_2_0-beta-b2'.

git-svn-id: https://svn.apache.org/repos/asf/xalan/java/tags/jaxp-ri-1_2_0-beta-b2@336154 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
No Author committed Mar 1, 2002
1 parent 8a890b6 commit 0f6bbfd
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 26 deletions.
11 changes: 9 additions & 2 deletions build.xml
Expand Up @@ -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"/>
Expand Down Expand Up @@ -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}"/>
Expand All @@ -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"/>
Expand Down Expand Up @@ -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}"/>
Expand Down Expand Up @@ -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" >
Expand Down
19 changes: 12 additions & 7 deletions src/org/apache/xalan/xsltc/runtime/TransletLoader.java
Expand Up @@ -57,13 +57,17 @@
* <http://www.apache.org/>.
*
* @author Morten Jorgensen
* @author Santiago Pericas-Geertsen
*
*/

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.
Expand Down Expand Up @@ -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;
}

Expand All @@ -108,6 +112,7 @@ public TransletLoader() {
public Class loadClass(String name) throws ClassNotFoundException {
return(Class.forName(name, false, _loader));
}

/**
* Loads a Class definition and runs static initializers.
*/
Expand Down
5 changes: 1 addition & 4 deletions src/org/apache/xalan/xsltc/trax/SAX2DOM.java
Expand Up @@ -57,7 +57,6 @@
* <http://www.apache.org/>.
*
* @author G. Todd Miller
*
*/


Expand Down Expand Up @@ -102,9 +101,7 @@ public void characters(char[] ch, int start, int length) {

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() {
Expand Down
10 changes: 8 additions & 2 deletions src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
Expand Up @@ -59,6 +59,7 @@
* @author Morten Jorgensen
* @author G. Todd Millerj
* @author Jochen Cordes <Jochen.Cordes@t-online.de>
* @author Santiago Pericas-Geertsen
*
*/

Expand Down Expand Up @@ -176,8 +177,13 @@ private void defineTransletClasses()
(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());
}
}
);
Expand Down
11 changes: 0 additions & 11 deletions src/trax/trax.properties

This file was deleted.

0 comments on commit 0f6bbfd

Please sign in to comment.