You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mm...@apache.org on 2001/08/07 23:50:48 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/transformer TransformerImpl.java
mmidy 01/08/07 14:50:48
Modified: java/src/org/apache/xalan/transformer TransformerImpl.java
Log:
Fix for bugzilla 1251. Make sure exceptions are thrown when we're on the main thread.
Revision Changes Path
1.113 +19 -7 xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java
Index: TransformerImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- TransformerImpl.java 2001/08/06 22:17:17 1.112
+++ TransformerImpl.java 2001/08/07 21:50:47 1.113
@@ -488,6 +488,7 @@
m_xmlSource = null;
m_doc = DTM.NULL;
m_isTransformDone = false;
+ m_transformThread = null;
// m_inputContentHandler = null;
// For now, reset the document cache each time.
@@ -615,9 +616,14 @@
if(null == base)
{
String currentDir = System.getProperty("user.dir");
-
- base = "file:///" + currentDir + java.io.File.separatorChar
- + source.getClass().getName();
+
+ if (currentDir.startsWith(java.io.File.separator))
+ base = "file://" + currentDir;
+ else
+ base = "file:///" + currentDir;
+
+ base = base + java.io.File.separatorChar
+ + source.getClass().getName();
}
setBaseURLOfSource(base);
DTMManager mgr = m_xcontext.getDTMManager();
@@ -633,8 +639,8 @@
}
finally
{
- if (shouldRelease)
- mgr.release(dtm, hardDelete);
+ if (shouldRelease)
+ mgr.release(dtm, hardDelete);
}
// Kick off the parse. When the ContentHandler gets
@@ -3127,7 +3133,10 @@
// e.printStackTrace();
// Strange that the other catch won't catch this...
- postExceptionFromThread(e);
+ if (null != m_transformThread)
+ postExceptionFromThread(e); // Assume we're on the main thread
+ else
+ throw new RuntimeException(e.getMessage());
}
finally
{
@@ -3148,7 +3157,10 @@
{
// e.printStackTrace();
- postExceptionFromThread(e);
+ if (null != m_transformThread)
+ postExceptionFromThread(e);
+ else
+ throw new RuntimeException(e.getMessage()); // Assume we're on the main thread.
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org