Author: mrglavas
Date: Sat May 27 22:20:23 2006
New Revision: 409928

URL: http://svn.apache.org/viewvc?rev=409928&view=rev
Log:
We shouldn't be catching and ignoring OutOfMemoryErrors and 
StackOverflowErrors. Re-throw them.

Modified:
    xerces/java/trunk/src/org/apache/xml/serialize/DOMSerializerImpl.java

Modified: xerces/java/trunk/src/org/apache/xml/serialize/DOMSerializerImpl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xml/serialize/DOMSerializerImpl.java?rev=409928&r1=409927&r2=409928&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xml/serialize/DOMSerializerImpl.java 
(original)
+++ xerces/java/trunk/src/org/apache/xml/serialize/DOMSerializerImpl.java Sat 
May 27 22:20:23 2006
@@ -1112,6 +1112,10 @@
             try {
                 return (String) 
DocumentMethods.fgDocumentGetXmlVersionMethod.invoke(doc, (Object[]) null);
             }
+            // The VM ran out of memory or there was some other serious 
problem. Re-throw.
+            catch (VirtualMachineError vme) {
+                throw vme;
+            }
             // ThreadDeath should always be re-thrown
             catch (ThreadDeath td) {
                 throw td;
@@ -1129,6 +1133,10 @@
             try {
                 return (String) 
DocumentMethods.fgDocumentGetInputEncodingMethod.invoke(doc, (Object[]) null);
             }
+            // The VM ran out of memory or there was some other serious 
problem. Re-throw.
+            catch (VirtualMachineError vme) {
+                throw vme;
+            }
             // ThreadDeath should always be re-thrown
             catch (ThreadDeath td) {
                 throw td;
@@ -1145,6 +1153,10 @@
         if (doc != null && DocumentMethods.fgDocumentMethodsAvailable) {
             try {
                 return (String) 
DocumentMethods.fgDocumentGetXmlEncodingMethod.invoke(doc, (Object[]) null);
+            }
+            // The VM ran out of memory or there was some other serious 
problem. Re-throw.
+            catch (VirtualMachineError vme) {
+                throw vme;
             }
             // ThreadDeath should always be re-thrown
             catch (ThreadDeath td) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to