Permalink
Browse files

Fix bug where profiling two pipelines with the same runtime caused an…

… error
  • Loading branch information...
ndw committed Feb 12, 2013
1 parent 806d5cd commit c3d9f75a29b5addab26505d99e2aaac72676fccc
Showing with 7 additions and 7 deletions.
  1. +7 −6 src/com/xmlcalabash/core/XProcRuntime.java
  2. +0 −1 src/com/xmlcalabash/library/DefaultStep.java
@@ -97,7 +97,6 @@
private Parser parser = null;
private XProcURIResolver uriResolver = null;
private XProcConfiguration config = null;
- private Vector<XStep> reported = new Vector<XStep> ();
private QName errorCode = null;
private XdmNode errorNode = null;
private String errorMessage = null;
@@ -445,7 +444,6 @@ public XLibrary getStandardLibrary() {
}
private void reset() {
- reported = new Vector<XStep> ();
errorCode = null;
errorMessage = null;
declaredSteps = new Hashtable<QName,DeclareStep> ();
@@ -783,10 +781,6 @@ public void finest(XProcRunnable step, XdmNode node, String message) {
// ===========================================================
- public void reportStep(XStep step) {
- reported.add(step);
- }
-
public void start(XStep step) {
if (profileFile == null) {
return;
@@ -843,6 +837,13 @@ public void finish(XStep step) {
serializer.setOutputStream(outstr);
S9apiUtils.serialize(this, result.getXdmNode(), serializer);
outstr.close();
+
+ profileWriter = new TreeWriter(this);
+ try {
+ profileWriter.startDocument(new URI("http://xmlcalabash.com/output/profile.xml"));
+ } catch (URISyntaxException use) {
+ // nop;
+ }
} catch (SaxonApiException sae) {
throw new XProcException(sae);
} catch (FileNotFoundException fnfe) {
@@ -158,7 +158,6 @@ public void run() throws SaxonApiException {
type = step.getType().getClarkName();
}
fine(null, "Running " + type + " " + step.getName());
- runtime.reportStep(step);
}
public Serializer makeSerializer() {

0 comments on commit c3d9f75

Please sign in to comment.