bodewig     2004/04/16 00:49:42

  Modified:    .        Tag: ANT_16_BRANCH WHATSNEW
               src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH
                        XSLTProcess.java
  Log:
  merge
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.503.2.69 +3 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.68
  retrieving revision 1.503.2.69
  diff -u -r1.503.2.68 -r1.503.2.69
  --- WHATSNEW  14 Apr 2004 16:13:43 -0000      1.503.2.68
  +++ WHATSNEW  16 Apr 2004 07:49:42 -0000      1.503.2.69
  @@ -43,6 +43,9 @@
     the -C switch to gcj.  This means you can now compile to native code
     with gcj which has been impossible in Ant < 1.6.2.
   
  +* <xslt> now sets the context classloader if you've specified a nested
  +  <classpath>.  Bugzilla report 24802.
  +
   Other changes:
   --------------
   
  
  
  
  No                   revision
  No                   revision
  1.78.2.5  +21 -3     
ant/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
  
  Index: XSLTProcess.java
  ===================================================================
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java,v
  retrieving revision 1.78.2.4
  retrieving revision 1.78.2.5
  diff -u -r1.78.2.4 -r1.78.2.5
  --- XSLTProcess.java  9 Mar 2004 17:01:34 -0000       1.78.2.4
  +++ XSLTProcess.java  16 Apr 2004 07:49:42 -0000      1.78.2.5
  @@ -121,6 +121,18 @@
       private boolean reuseLoadedStylesheet = true;
   
       /**
  +     * AntClassLoader for the nested &lt;classpath&gt; - 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.
        */
       public XSLTProcess() {
  @@ -170,6 +182,7 @@
           if (inFile != null && !inFile.exists()) {
               throw new BuildException("input file " + inFile.toString() + " 
does not exist", getLocation());
           }
  +
           try {
               if (baseDir == null) {
                   baseDir = getProject().resolveFile(".");
  @@ -233,6 +246,10 @@
                   }
               }
           } finally {
  +            if (loader != null) {
  +                loader.resetThreadContextLoader();
  +                loader = null;
  +            }
               liaison = null;
               stylesheetLoaded = false;
               baseDir = savedBaseDir;
  @@ -379,8 +396,9 @@
           if (classpath == null) {
               return Class.forName(classname);
           } 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;
           }
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to