|
@@ -120,6 +120,18 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { |
|
|
*/ |
|
|
*/ |
|
|
private boolean reuseLoadedStylesheet = true; |
|
|
private boolean reuseLoadedStylesheet = true; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* AntClassLoader for the nested <classpath> - if set. |
|
|
|
|
|
* |
|
|
|
|
|
* <p>We keep this here in order to reset the context classloader |
|
|
|
|
|
* in execute. We can't use liaison.getClass().getClassLoader() |
|
|
|
|
|
* since the actual liaison class may have been loaded by a loader |
|
|
|
|
|
* higher up (system classloader, for example).</p> |
|
|
|
|
|
* |
|
|
|
|
|
* @since Ant 1.6.2 |
|
|
|
|
|
*/ |
|
|
|
|
|
private AntClassLoader loader = null; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Creates a new XSLTProcess Task. |
|
|
* Creates a new XSLTProcess Task. |
|
|
*/ |
|
|
*/ |
|
@@ -170,6 +182,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { |
|
|
if (inFile != null && !inFile.exists()) { |
|
|
if (inFile != null && !inFile.exists()) { |
|
|
throw new BuildException("input file " + inFile.toString() + " does not exist", getLocation()); |
|
|
throw new BuildException("input file " + inFile.toString() + " does not exist", getLocation()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
if (baseDir == null) { |
|
|
if (baseDir == null) { |
|
|
baseDir = getProject().resolveFile("."); |
|
|
baseDir = getProject().resolveFile("."); |
|
@@ -233,6 +246,10 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} finally { |
|
|
} finally { |
|
|
|
|
|
if (loader != null) { |
|
|
|
|
|
loader.resetThreadContextLoader(); |
|
|
|
|
|
loader = null; |
|
|
|
|
|
} |
|
|
liaison = null; |
|
|
liaison = null; |
|
|
stylesheetLoaded = false; |
|
|
stylesheetLoaded = false; |
|
|
baseDir = savedBaseDir; |
|
|
baseDir = savedBaseDir; |
|
@@ -379,8 +396,9 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { |
|
|
if (classpath == null) { |
|
|
if (classpath == null) { |
|
|
return Class.forName(classname); |
|
|
return Class.forName(classname); |
|
|
} else { |
|
|
} else { |
|
|
AntClassLoader al = getProject().createClassLoader(classpath); |
|
|
|
|
|
Class c = Class.forName(classname, true, al); |
|
|
|
|
|
|
|
|
loader = getProject().createClassLoader(classpath); |
|
|
|
|
|
loader.setThreadContextLoader(); |
|
|
|
|
|
Class c = Class.forName(classname, true, loader); |
|
|
return c; |
|
|
return c; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|