You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by cu...@apache.org on 2001/02/23 22:01:22 UTC

cvs commit: xml-xalan/test/java/src/org/apache/qetest/xslwrapper TraxWrapper.java

curcuru     01/02/23 13:01:22

  Modified:    test/java/src/org/apache/qetest/xslwrapper TraxWrapper.java
  Log:
  Update getDescription to work even if processor hasn't been created yet
  
  Revision  Changes    Path
  1.11      +23 -17    xml-xalan/test/java/src/org/apache/qetest/xslwrapper/TraxWrapper.java
  
  Index: TraxWrapper.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xslwrapper/TraxWrapper.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TraxWrapper.java	2001/01/09 05:43:38	1.10
  +++ TraxWrapper.java	2001/02/23 21:01:20	1.11
  @@ -108,7 +108,7 @@
    * @todo share constants between TraxWrapper, SaxonWrapper
    * @todo document how we perform various types of transforms
    * @author Shane Curcuru
  - * @version $Id: TraxWrapper.java,v 1.10 2001/01/09 05:43:38 sboag Exp $
  + * @version $Id: TraxWrapper.java,v 1.11 2001/02/23 21:01:20 curcuru Exp $
    */
   public class TraxWrapper extends ProcessorWrapper
   {
  @@ -303,30 +303,36 @@
   
       /**
        * Get a description of the wrappered processor.
  +     * Note: Now auto-creates a processor if needed: this could 
  +     * have unintended side-effects in future applications, but 
  +     * makes the current code much simpler.  In the future, we'll 
  +     * probably get rid of the system property setting stuff and 
  +     * just have subclasses for every flavor.
        * @return info-string describing the processor and possibly it's common options
        */
       public String getDescription()
       {
  -
  -        if (processor == null)
  +        if (null == processor)
           {
  -            return ("ERROR: must call createNewProcessor first from: "
  -                    + getDescription());
  +            try
  +            {
  +                createNewProcessor(null);
  +            }
  +            catch (Exception e)
  +            {
  +                /* no-op, let it fail: we can continue anyways */
  +            }
           }
  -        else
  -        {
  -            StringBuffer buf = new StringBuffer("TRaX");
   
  -            buf.append(";");
  -            buf.append("Java");
  -            buf.append(";");
  -            buf.append(
  -                System.getProperties().getProperty(TRAX_PROCESSOR_XSLT));  // TODO - improve this
  -            buf.append(";");
  -            buf.append(System.getProperties().getProperty(TRAX_WRAPPER_TYPE));  // TODO - improve this
  +        StringBuffer buf = new StringBuffer("TRaX");
  +        buf.append(";");
  +        buf.append("Java");
  +        buf.append(";");
  +        buf.append(System.getProperties().getProperty(TRAX_PROCESSOR_XSLT));  // TODO - improve this
  +        buf.append(";");
  +        buf.append(System.getProperties().getProperty(TRAX_WRAPPER_TYPE));  // TODO - improve this
   
  -            return buf.toString();
  -        }
  +        return buf.toString();
       }
   
       /**