diff options
author | Mark Wielaard <mark@klomp.org> | 2006-03-04 20:45:32 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2006-03-04 20:45:32 +0000 |
commit | ffd0b84fdfbf2e69332e684e017f9810b2b085aa (patch) | |
tree | aba7e03bb8a606c5859752d5484d510f57beaf8f | |
parent | 812c5a072d5f8830e68c254f813f03ac52c144bf (diff) | |
download | classpath-ffd0b84fdfbf2e69332e684e017f9810b2b085aa.tar.gz |
* gnu/xml/stream/SAXParser.java (parse(InputSource)): Ignore
exceptions thrown by handlers while cleaning up and rethrow original
exception.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gnu/xml/stream/SAXParser.java | 23 |
2 files changed, 22 insertions, 7 deletions
@@ -1,3 +1,9 @@ +2006-03-04 Mark Wielaard <mark@klomp.org> + + * gnu/xml/stream/SAXParser.java (parse(InputSource)): Ignore + exceptions thrown by handlers while cleaning up and rethrow original + exception. + 2006-03-04 Tom Tromey <tromey@redhat.com> * java/beans/PropertyDescriptor.java (createPropertyEditor): New diff --git a/gnu/xml/stream/SAXParser.java b/gnu/xml/stream/SAXParser.java index 9dd0921ba..fd768a43d 100644 --- a/gnu/xml/stream/SAXParser.java +++ b/gnu/xml/stream/SAXParser.java @@ -1,5 +1,5 @@ /* SAXParser.java -- - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -657,17 +657,26 @@ public class SAXParser } catch (Exception e) { - if (!startDocumentDone && contentHandler != null) - contentHandler.startDocument(); SAXParseException e2 = new SAXParseException(e.getMessage(), this); e2.initCause(e); - if (errorHandler != null) - errorHandler.fatalError(e2); - if (contentHandler != null) - contentHandler.endDocument(); + try + { + if (!startDocumentDone && contentHandler != null) + contentHandler.startDocument(); + if (errorHandler != null) + errorHandler.fatalError(e2); + if (contentHandler != null) + contentHandler.endDocument(); + } + catch (SAXException sex) + { + // Ignored, we will rethrow the original exception. + } reset(); if (opened) in.close(); + if (e instanceof SAXException) + throw (SAXException) e; if (e instanceof IOException) throw (IOException) e; else |