Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Ferguson2007-07-11 09:44:37 +0000
committerAndrew Ferguson2007-07-11 09:44:37 +0000
commitfbe4e146c8015f5c4955c49ba41853f39d2db897 (patch)
tree380b6151cc96100506b31532d29b515f8afdf7c8 /core/org.eclipse.cdt.core/templateengine
parent27da9e732eaf1b62b99a30d807c21122ea8736b1 (diff)
downloadorg.eclipse.cdt-fbe4e146c8015f5c4955c49ba41853f39d2db897.tar.gz
org.eclipse.cdt-fbe4e146c8015f5c4955c49ba41853f39d2db897.tar.xz
org.eclipse.cdt-fbe4e146c8015f5c4955c49ba41853f39d2db897.zip
bug 194359: apply workaround for bug in XalanJ
Diffstat (limited to 'core/org.eclipse.cdt.core/templateengine')
-rw-r--r--core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/SharedDefaults.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/SharedDefaults.java b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/SharedDefaults.java
index 927292ef60d..40a5f7af983 100644
--- a/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/SharedDefaults.java
+++ b/core/org.eclipse.cdt.core/templateengine/org/eclipse/cdt/core/templateengine/SharedDefaults.java
@@ -11,6 +11,8 @@
package org.eclipse.cdt.core.templateengine;
import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -19,6 +21,8 @@ import java.util.Map;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Result;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
@@ -271,11 +275,24 @@ public class SharedDefaults extends HashMap/*<String, String>*/ {
DOMSource domSource = new DOMSource(d);
TransformerFactory transFactory = TransformerFactory.newInstance();
- Result fileResult = new StreamResult(xmlFile);
+
try {
- transFactory.newTransformer().transform(domSource, fileResult);
- } catch (Throwable t) {
- TemplateEngineUtil.log(t);
+ FileOutputStream fos= null;
+ try {
+ fos= new FileOutputStream(xmlFile);
+ Result fileResult = new StreamResult(fos);
+ transFactory.newTransformer().transform(domSource, fileResult);
+ } finally {
+ if(fos!=null) {
+ fos.close();
+ }
+ }
+ } catch(IOException ioe) {
+ TemplateEngineUtil.log(ioe);
+ } catch(TransformerConfigurationException tce) {
+ TemplateEngineUtil.log(tce);
+ } catch(TransformerException te) {
+ TemplateEngineUtil.log(te);
}
return xmlFile;
}

Back to the top