You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2002/01/25 14:27:48 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/transformation XTTransformer.java

cziegeler    02/01/25 05:27:48

  Modified:    src/java/org/apache/cocoon/transformation XTTransformer.java
  Log:
  Fixed NPE in XTTransformer reported by Gilles Beaugeais [beaugeais@syselog.fr]
  
  Revision  Changes    Path
  1.2       +7 -3      xml-cocoon2/src/java/org/apache/cocoon/transformation/XTTransformer.java
  
  Index: XTTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/XTTransformer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XTTransformer.java	3 Jan 2002 12:31:20 -0000	1.1
  +++ XTTransformer.java	25 Jan 2002 13:27:48 -0000	1.2
  @@ -49,7 +49,7 @@
    * This Transformer use the XT processor.
    *
    * @author <a href="mailto:ssahuc@imediation.com">Sahuc Sebastien</a>
  - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:20 $
  + * @version CVS $Revision: 1.2 $ $Date: 2002/01/25 13:27:48 $
    */
   public class XTTransformer extends DocumentHandlerWrapper
   implements Transformer, Composable, Loggable, Recyclable, Disposable {
  @@ -107,14 +107,17 @@
   
           if (store != null) {
               loaderprocessor = (XTProcessor) store.get(xsluri);
  -            loaderprocessor.setLogger(this.log);
  -            loaderprocessor.compose(this.manager);
  +            if (loaderprocessor != null) {
  +                loaderprocessor.setLogger(this.log);
  +                loaderprocessor.compose(this.manager);
  +            }
           }
   
           // If not in the store or if style sheet has changed, loads and stores it
           if (loaderprocessor == null || loaderprocessor.hasChanged()) {
               loaderprocessor= new XTProcessor();
               loaderprocessor.setLogger(this.log);
  +            loaderprocessor.compose(this.manager);
               SAXParser saxParser = null;
               try {
                   saxParser = SAXParserFactory.newInstance().newSAXParser();
  @@ -137,6 +140,7 @@
           // Indeed 1 instance per thread is allowed
           this.processor = (XTProcessor) loaderprocessor.clone();
           this.processor.setLogger(this.log);
  +        this.processor.compose(this.manager);
   
           // Create the processor and set it as this documenthandler
           // FIXME (SS): set the correct SystemId to the XML inputSource
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org