FYI: Merge fix for PR 30831

Gary Benson gbenson@redhat.com
Fri Mar 9 10:15:00 GMT 2007


Hi all,

This commit merges the fix for PR 30831.

Cheers,
Gary
-------------- next part --------------
Index: ChangeLog.gcj
===================================================================
--- ChangeLog.gcj	(revision 122700)
+++ ChangeLog.gcj	(working copy)
@@ -1,3 +1,10 @@
+2007-03-09  Gary Benson  <gbenson@redhat.com>
+	    Chris Burdess  <dog@gnu.org>
+
+	PR classpath/30831
+	* gnu/xml/dom/ls/SAXEventSink.java: Only set extended document
+	properties when reader is available.
+
 2007-03-08  Gary Benson  <gbenson@redhat.com>
 
 	PR classpath/30983:
Index: gnu/xml/dom/ls/SAXEventSink.java
===================================================================
--- gnu/xml/dom/ls/SAXEventSink.java	(revision 122699)
+++ gnu/xml/dom/ls/SAXEventSink.java	(working copy)
@@ -144,37 +144,40 @@
     final String PROPERTIES = "http://xml.org/sax/properties/";
     final String GNU_PROPERTIES = "http://gnu.org/sax/properties/";
 
-    boolean standalone = reader.getFeature(FEATURES + "is-standalone");
-    doc.setXmlStandalone(standalone);
-    try
+    if (reader != null)
       {
-        String version = (String) reader.getProperty(PROPERTIES +
-                                                     "document-xml-version");
-        doc.setXmlVersion(version);
+        boolean standalone = reader.getFeature(FEATURES + "is-standalone");
+        doc.setXmlStandalone(standalone);
+        try
+          {
+            String version = (String) reader.getProperty(PROPERTIES +
+                    "document-xml-version");
+            doc.setXmlVersion(version);
+          }
+        catch (SAXNotRecognizedException e)
+          {
+          }
+        catch (SAXNotSupportedException e)
+          {
+          }
+        try
+          {
+              String encoding = (String) reader.getProperty(GNU_PROPERTIES +
+                      "document-xml-encoding");
+              doc.setXmlEncoding(encoding);
+          }
+        catch (SAXNotRecognizedException e)
+          {
+          }
+        catch (SAXNotSupportedException e)
+          {
+          }
       }
-    catch (SAXNotRecognizedException e)
-      {
-      }
-    catch (SAXNotSupportedException e)
-      {
-      }
     if (locator != null && locator instanceof Locator2)
       {
         String encoding = ((Locator2) locator).getEncoding();
         doc.setInputEncoding(encoding);
       }
-    try
-      {
-        String encoding = (String) reader.getProperty(GNU_PROPERTIES +
-                                                      "document-xml-encoding");
-        doc.setXmlEncoding(encoding);
-      }
-    catch (SAXNotRecognizedException e)
-      {
-      }
-    catch (SAXNotSupportedException e)
-      {
-      }
   }
 
   public void endDocument()


More information about the Java-patches mailing list