changeset 588:1af33ab1bc58

8027484: Implementation error in SAX2DOM.java Reviewed-by: alanb, lancea
author joehw
date Tue, 29 Oct 2013 14:52:51 -0700
parents 96562bf197f2
children 04778b00286a
files src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Mon Oct 28 12:26:22 2013 -0700
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Tue Oct 29 14:52:51 2013 -0700
@@ -74,12 +74,12 @@
             DocumentBuilderFactory.newInstance();
     private boolean _internal = true;
 
-    public SAX2DOM(boolean useServicesMachnism) throws ParserConfigurationException {
-        _document = createDocument(useServicesMachnism);
+    public SAX2DOM(boolean useServicesMechanism) throws ParserConfigurationException {
+        _document = createDocument(useServicesMechanism);
         _root = _document;
     }
 
-    public SAX2DOM(Node root, Node nextSibling, boolean useServicesMachnism) throws ParserConfigurationException {
+    public SAX2DOM(Node root, Node nextSibling, boolean useServicesMechanism) throws ParserConfigurationException {
         _root = root;
         if (root instanceof Document) {
           _document = (Document)root;
@@ -88,15 +88,15 @@
           _document = root.getOwnerDocument();
         }
         else {
-          _document = createDocument(useServicesMachnism);
+          _document = createDocument(useServicesMechanism);
           _root = _document;
         }
 
         _nextSibling = nextSibling;
     }
 
-    public SAX2DOM(Node root, boolean useServicesMachnism) throws ParserConfigurationException {
-        this(root, null, useServicesMachnism);
+    public SAX2DOM(Node root, boolean useServicesMechanism) throws ParserConfigurationException {
+        this(root, null, useServicesMechanism);
     }
 
     public Node getDOM() {
@@ -308,18 +308,19 @@
     public void startDTD(String name, String publicId, String systemId)
         throws SAXException {}
 
-    private Document createDocument(boolean useServicesMachnism) throws ParserConfigurationException {
+    private Document createDocument(boolean useServicesMechanism) throws ParserConfigurationException {
         if (_factory == null) {
-            if (useServicesMachnism)
+            if (useServicesMechanism) {
                 _factory = DocumentBuilderFactory.newInstance();
                 if (!(_factory instanceof com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl)) {
                     _internal = false;
                 }
-            else
+            } else {
                 _factory = DocumentBuilderFactory.newInstance(
                   "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl",
                   SAX2DOM.class.getClassLoader()
                   );
+            }
         }
         Document doc;
         if (_internal) {