This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 34672
Collapse All | Expand All

(-)src/org/netbeans/modules/xsl/utils/TransformUtil.java (+26 lines)
Lines 17-22 Link Here
17
import java.io.IOException;
17
import java.io.IOException;
18
import java.net.URL;
18
import java.net.URL;
19
import java.net.MalformedURLException;
19
import java.net.MalformedURLException;
20
import java.security.*;
20
21
21
import org.xml.sax.*;
22
import org.xml.sax.*;
22
import javax.xml.parsers.*;
23
import javax.xml.parsers.*;
Lines 26-31 Link Here
26
27
27
import org.openide.filesystems.*;
28
import org.openide.filesystems.*;
28
import org.openide.loaders.DataObject;
29
import org.openide.loaders.DataObject;
30
import org.openide.execution.*;
29
31
30
import org.netbeans.api.xml.cookies.*;
32
import org.netbeans.api.xml.cookies.*;
31
import org.netbeans.api.xml.services.UserCatalog;
33
import org.netbeans.api.xml.services.UserCatalog;
Lines 239-245 Link Here
239
            
241
            
240
                if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("\n==> transform: param [transformer] = " + transformer.getParameter ("transformer")); // debug
242
                if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("\n==> transform: param [transformer] = " + transformer.getParameter ("transformer")); // debug
241
243
244
                // Support Xalan java extensions located using context classloader
245
                // set the classloader to repository one
246
                ClassLoader cl = Thread.currentThread().getContextClassLoader();
247
                try {
248
                    Thread.currentThread().setContextClassLoader(currentClassLoader()); 
242
                transformer.transform (xml, output);
249
                transformer.transform (xml, output);
250
                } finally {
251
                    Thread.currentThread().setContextClassLoader(cl);
252
                }
253
243
            } catch (Exception exc) { // TransformerException, ParserConfigurationException, SAXException, FileStateInvalidException
254
            } catch (Exception exc) { // TransformerException, ParserConfigurationException, SAXException, FileStateInvalidException
244
                if ( Util.THIS.isLoggable() ) /* then */ {
255
                if ( Util.THIS.isLoggable() ) /* then */ {
245
                    Util.THIS.debug ("    EXCEPTION during transformation: " + exc.getClass().getName(), exc);
256
                    Util.THIS.debug ("    EXCEPTION during transformation: " + exc.getClass().getName(), exc);
Lines 284-289 Link Here
284
                throw transExcept;
295
                throw transExcept;
285
            }
296
            }
286
        }
297
        }
298
    }
299
300
    // C&p from TopManager
301
    private static ClassLoader currentClassLoader () {
302
        NbClassLoader l = new NbClassLoader();
303
        l.setDefaultPermissions(getAllPermissions());
304
        return l;
305
    }
306
    private static PermissionCollection allPermission;
307
    static synchronized PermissionCollection getAllPermissions() {
308
        if (allPermission == null) {
309
            allPermission = new Permissions();
310
            allPermission.add(new AllPermission());
311
        }
312
        return allPermission;
287
    }
313
    }
288
314
289
    /** Unwrap wrapped cause exception.
315
    /** Unwrap wrapped cause exception.

Return to bug 34672