summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Burdess <dog@bluezoo.org>2006-12-06 11:36:42 +0000
committerChris Burdess <dog@bluezoo.org>2006-12-06 11:36:42 +0000
commit6162e5d91009524030a8e3855b111360410fe342 (patch)
treea447cd8e3bc16f19203c6526e3caf0b26051c101
parentbb86f4e4d4138b46926fdaecd0c9c700ee3985e1 (diff)
downloadclasspath-6162e5d91009524030a8e3855b111360410fe342.tar.gz
2006-12-06 Chris Burdess <dog@gnu.org>
Fixes PR 29272. * javax/xml/parsers/DocumentBuilderFactory.java: Fix broken Javadoc. * gnu/xml/stream/SAXParser.java: Fix file descriptor leak.
-rw-r--r--ChangeLog6
-rw-r--r--gnu/xml/stream/SAXParser.java15
-rw-r--r--javax/xml/parsers/DocumentBuilderFactory.java2
3 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index f375d3be5..2ca8accac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-12-06 Chris Burdess <dog@gnu.org>
+ Fixes PR 29272.
+ * javax/xml/parsers/DocumentBuilderFactory.java: Fix broken Javadoc.
+ * gnu/xml/stream/SAXParser.java: Fix file descriptor leak.
+
+2006-12-06 Chris Burdess <dog@gnu.org>
+
Fixes PR 29264.
* gnu/xml/stream/XMLStreamWriterImpl.java: Allow arbitrary text in
writeDTD method.
diff --git a/gnu/xml/stream/SAXParser.java b/gnu/xml/stream/SAXParser.java
index e58d5fb52..e037560b1 100644
--- a/gnu/xml/stream/SAXParser.java
+++ b/gnu/xml/stream/SAXParser.java
@@ -1021,9 +1021,18 @@ public class SAXParser
SAXParser parser = new SAXParser(validating, namespaceAware,
xIncludeAware);
InputSource input = new InputSource(args[pos]);
- XMLReader reader = parser.getXMLReader();
- reader.setContentHandler(handler);
- reader.parse(input);
+ FileReader fr = new java.io.FileReader(args[pos]);
+ input.setCharacterStream(fr);
+ try
+ {
+ XMLReader reader = parser.getXMLReader();
+ reader.setContentHandler(handler);
+ reader.parse(input);
+ }
+ finally
+ {
+ fr.close();
+ }
pos++;
}
}
diff --git a/javax/xml/parsers/DocumentBuilderFactory.java b/javax/xml/parsers/DocumentBuilderFactory.java
index 0dc574e65..9312e65e0 100644
--- a/javax/xml/parsers/DocumentBuilderFactory.java
+++ b/javax/xml/parsers/DocumentBuilderFactory.java
@@ -50,7 +50,7 @@ import javax.xml.validation.Schema;
* Factory for obtaining document builders.
* Instances of this class are <em>not</em> guaranteed to be thread safe.
*
- * @author (a href='mailto:dog@gnu.org'>Chris Burdess</a)
+ * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
*/
public abstract class DocumentBuilderFactory
{