This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[4.1] [patch] Fix bug in xml transformer
- From: Matthias Klose <doko at cs dot tu-berlin dot de>
- To: java at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Thu, 8 Dec 2005 16:22:52 +0100
- Subject: [4.1] [patch] Fix bug in xml transformer
Fix bug in xml transformer, needed to fix eclipse's handling of its
configuration files, proposed by Michael Koch.
AFAIU, this patch form classpath trunk should not be applied to the
trunk, but to to the 4.1 branch only and mentioned in
libjava/classpath/ChangeLog.gcj.
Ok to apply?
Matthias
2005-11-20 Chris Burdess <dog@gnu.org>
* gnu/xml/transform/TransformerImpl.java: Ensure that output stream
is not closed if provided in the StreamResult.
Index: gnu/xml/transform/TransformerImpl.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/transform/TransformerImpl.java,v
retrieving revision 1.6
diff -u -r1.6 TransformerImpl.java
--- libjava/classpath/gnu/xml/transform/TransformerImpl.java 30 Sep 2005 07:17:04 -0000 1.6
+++ libjava/classpath/gnu/xml/transform/TransformerImpl.java 20 Nov 2005 12:02:48 -0000
@@ -487,6 +487,7 @@
throws IOException
{
OutputStream out = null;
+ boolean created = false;
try
{
out = sr.getOutputStream();
@@ -523,6 +524,7 @@
URL url = new URL(systemId);
out = new FileOutputStream(url.getPath());
}
+ created = true;
}
out = new BufferedOutputStream(out);
StreamSerializer serializer =
@@ -539,7 +541,7 @@
{
try
{
- if (out != null)
+ if (out != null && created)
{
out.close();
}