You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by sb...@apache.org on 2001/08/03 00:47:16 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit AggregateTransformer.java

sbailliez    01/08/02 15:47:16

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/junit
                        AggregateTransformer.java
  Log:
  Fixed a possible systemid problem reported by glennmaughan@optushome.com.au (Glenn Maughan)
  Moved the timing garbage generated as well to a global timing instead...
  
  Revision  Changes    Path
  1.4       +4 -5      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java
  
  Index: AggregateTransformer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AggregateTransformer.java	2001/03/02 15:59:19	1.3
  +++ AggregateTransformer.java	2001/08/02 22:47:16	1.4
  @@ -221,6 +221,7 @@
   
       public void transform() throws BuildException {
           checkOptions();
  +        final long t0 = System.currentTimeMillis();
           try {
               Element root = document.getDocumentElement();
                           
  @@ -237,9 +238,10 @@
                   createAllPackageDetails(root);
               }
           } catch (Exception e){
  -            e.printStackTrace();
               throw new BuildException("Errors while applying transformations", e);
           }
  +        final long dt = System.currentTimeMillis() - t0;
  +        task.log("Transform time: " + dt + "ms");
       }
   
       /** check for invalid options */
  @@ -447,7 +449,6 @@
        */
       protected void transform(Node root, String xslname, String htmlname) throws SAXException {
           try{
  -            final long t0 = System.currentTimeMillis();
               XSLTInputSource xsl_source = getXSLStreamSource(xslname);
               XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
               File htmlfile = new File(toDir, htmlname);
  @@ -458,8 +459,6 @@
               }
               task.log("Applying '" + xslname + "'. Generating '" + htmlfile + "'", Project.MSG_VERBOSE);
               processor.process( new XSLTInputSource(root), xsl_source, new XSLTResultTarget(htmlfile.getAbsolutePath()) );
  -            final long dt = System.currentTimeMillis() - t0;
  -            task.log("Transform time for " + xslname + ": " + dt + "ms");
           } catch (IOException e){
               task.log(e.getMessage(), Project.MSG_ERR);
               e.printStackTrace(); //@todo bad, change this
  @@ -482,7 +481,7 @@
           } else {
               File f = new File(styleDir, name);
               in= new FileInputStream(f);
  -            systemId = f.getAbsolutePath();
  +            systemId = "file:///" + f.getAbsolutePath();
           }
           XSLTInputSource ss = new XSLTInputSource(in);
           ss.setSystemId(systemId);