Browse Source

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...


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269448 13f79535-47bb-0310-9956-ffa450edef68
master
Stephane Bailliez 24 years ago
parent
commit
af7fb0127a
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java

+ 4
- 5
src/main/org/apache/tools/ant/taskdefs/optional/junit/AggregateTransformer.java View File

@@ -221,6 +221,7 @@ public class AggregateTransformer {


public void transform() throws BuildException { public void transform() throws BuildException {
checkOptions(); checkOptions();
final long t0 = System.currentTimeMillis();
try { try {
Element root = document.getDocumentElement(); Element root = document.getDocumentElement();
@@ -237,9 +238,10 @@ public class AggregateTransformer {
createAllPackageDetails(root); createAllPackageDetails(root);
} }
} catch (Exception e){ } catch (Exception e){
e.printStackTrace();
throw new BuildException("Errors while applying transformations", e); throw new BuildException("Errors while applying transformations", e);
} }
final long dt = System.currentTimeMillis() - t0;
task.log("Transform time: " + dt + "ms");
} }


/** check for invalid options */ /** check for invalid options */
@@ -447,7 +449,6 @@ public class AggregateTransformer {
*/ */
protected void transform(Node root, String xslname, String htmlname) throws SAXException { protected void transform(Node root, String xslname, String htmlname) throws SAXException {
try{ try{
final long t0 = System.currentTimeMillis();
XSLTInputSource xsl_source = getXSLStreamSource(xslname); XSLTInputSource xsl_source = getXSLStreamSource(xslname);
XSLTProcessor processor = XSLTProcessorFactory.getProcessor(); XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
File htmlfile = new File(toDir, htmlname); File htmlfile = new File(toDir, htmlname);
@@ -458,8 +459,6 @@ public class AggregateTransformer {
} }
task.log("Applying '" + xslname + "'. Generating '" + htmlfile + "'", Project.MSG_VERBOSE); task.log("Applying '" + xslname + "'. Generating '" + htmlfile + "'", Project.MSG_VERBOSE);
processor.process( new XSLTInputSource(root), xsl_source, new XSLTResultTarget(htmlfile.getAbsolutePath()) ); 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){ } catch (IOException e){
task.log(e.getMessage(), Project.MSG_ERR); task.log(e.getMessage(), Project.MSG_ERR);
e.printStackTrace(); //@todo bad, change this e.printStackTrace(); //@todo bad, change this
@@ -482,7 +481,7 @@ public class AggregateTransformer {
} else { } else {
File f = new File(styleDir, name); File f = new File(styleDir, name);
in= new FileInputStream(f); in= new FileInputStream(f);
systemId = f.getAbsolutePath();
systemId = "file:///" + f.getAbsolutePath();
} }
XSLTInputSource ss = new XSLTInputSource(in); XSLTInputSource ss = new XSLTInputSource(in);
ss.setSystemId(systemId); ss.setSystemId(systemId);


Loading…
Cancel
Save