This is an automated email from the ASF dual-hosted git repository.

veithen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-axiom.git


The following commit(s) were added to refs/heads/master by this push:
     new 89cc08228 Remove obsolete code
89cc08228 is described below

commit 89cc0822811e3d791d23a9ba2b337193e5fb3a66
Author: Andreas Veithen <andreas.veit...@gmail.com>
AuthorDate: Mon Jan 1 16:26:27 2024 +0000

    Remove obsolete code
    
    We no longer test with Crimson as DOM implementation, so we can remove
    related code.
---
 .../axiom/ts/dimension/DOMBuilderFactory.java      |  4 ---
 .../ts/om/builder/TestCreateOMBuilderFromDOM.java  |  1 -
 .../axiom/ts/jaxp/dom/DOMImplementation.java       | 42 ++--------------------
 3 files changed, 2 insertions(+), 45 deletions(-)

diff --git 
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/dimension/DOMBuilderFactory.java
 
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/dimension/DOMBuilderFactory.java
index 46336315b..a7c1639aa 100644
--- 
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/dimension/DOMBuilderFactory.java
+++ 
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/dimension/DOMBuilderFactory.java
@@ -44,10 +44,6 @@ final class DOMBuilderFactory extends BuilderFactory {
 
     @Override
     public void configureXMLStreamReaderComparator(XMLStreamReaderComparator 
comparator) {
-        comparator.setCompareCharacterEncodingScheme(implementation.isDOM3());
-        comparator.setCompareEncoding(implementation.isDOM3());
-        
comparator.setCompareInternalSubset(implementation.supportsGetInternalSubset());
-        comparator.setTreatSpaceAsCharacters(!implementation.isDOM3());
         // DOM gives access to the parsed replacement value (via the Entity 
interface), but Axiom
         // stores the unparsed replacement value. Therefore 
OMEntityReference#getReplacementText()
         // returns null for nodes created from a DOM tree.
diff --git 
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOM.java
 
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOM.java
index e0c3b9f6c..3b4e7d281 100644
--- 
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOM.java
+++ 
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOM.java
@@ -83,7 +83,6 @@ public class TestCreateOMBuilderFromDOM extends 
ConformanceTestCase {
         assertAbout(xml())
                 .that(actual)
                 .ignoringWhitespaceInPrologAndEpilog()
-                
.treatingElementContentWhitespaceAsText(!implementation.isDOM3())
                 .hasSameContentAs(
                         loadDocument(expandEntityReferences == null || 
expandEntityReferences));
     }
diff --git 
a/testing/jaxp-testsuite/src/main/java/org/apache/axiom/ts/jaxp/dom/DOMImplementation.java
 
b/testing/jaxp-testsuite/src/main/java/org/apache/axiom/ts/jaxp/dom/DOMImplementation.java
index 7bd52f291..380930e0f 100644
--- 
a/testing/jaxp-testsuite/src/main/java/org/apache/axiom/ts/jaxp/dom/DOMImplementation.java
+++ 
b/testing/jaxp-testsuite/src/main/java/org/apache/axiom/ts/jaxp/dom/DOMImplementation.java
@@ -26,15 +26,12 @@ import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.axiom.testing.multiton.Multiton;
 import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
 public abstract class DOMImplementation extends Multiton {
     public static final DOMImplementation XERCES =
-            new DOMImplementation("xerces", true, true) {
+            new DOMImplementation("xerces") {
                 @Override
                 protected DocumentBuilderFactory newDocumentBuilderFactory() {
                     return new 
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl();
@@ -42,27 +39,15 @@ public abstract class DOMImplementation extends Multiton {
             };
 
     private final String name;
-    private final boolean dom3;
-    private final boolean internalSubset;
 
-    private DOMImplementation(String name, boolean dom3, boolean 
internalSubset) {
+    private DOMImplementation(String name) {
         this.name = name;
-        this.dom3 = dom3;
-        this.internalSubset = internalSubset;
     }
 
     public final String getName() {
         return name;
     }
 
-    public final boolean isDOM3() {
-        return dom3;
-    }
-
-    public final boolean supportsGetInternalSubset() {
-        return internalSubset;
-    }
-
     protected abstract DocumentBuilderFactory newDocumentBuilderFactory();
 
     public final Document newDocument() {
@@ -88,32 +73,9 @@ public abstract class DOMImplementation extends Multiton {
         } catch (ParserConfigurationException ex) {
             throw new Error("Unexpected exception", ex);
         }
-        if (!expandEntityReferences) {
-            // Crimson creates EntityReference nodes for predefined entities 
(such as &lt;);
-            // expand them.
-            expandPredefinedEntityReferences(document.getDocumentElement());
-        }
         return document;
     }
 
-    private void expandPredefinedEntityReferences(Element element) {
-        Node child = element.getFirstChild();
-        while (child != null) {
-            switch (child.getNodeType()) {
-                case Node.ELEMENT_NODE:
-                    expandPredefinedEntityReferences((Element) child);
-                    break;
-                case Node.ENTITY_REFERENCE_NODE:
-                    if (child.getNodeName().equals("lt")) {
-                        Text content = (Text) 
child.getFirstChild().cloneNode(false);
-                        element.replaceChild(content, child);
-                        child = content;
-                    }
-            }
-            child = child.getNextSibling();
-        }
-    }
-
     public final Document parse(InputStream in) throws SAXException, 
IOException {
         return parse(new InputSource(in));
     }

Reply via email to