[java-shib-shared] 02/09: JSSH-71 Remove the impact of the DestructableComponent Interface

Codeberg noreply at shibboleth.net
Mon Jul 6 15:29:29 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch dev/JSSH-71-old
in repository java-shib-shared.

View the commit online:
https://codeberg.org/Shibboleth/java-shib-shared/commit/8e648aa71fe84bfcb4a66f3497715b3430dcdaa5

commit 8e648aa71fe84bfcb4a66f3497715b3430dcdaa5
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu May 21 13:42:31 2026 +0100

    JSSH-71 Remove the impact of the DestructableComponent Interface
    
    https://shibboleth.atlassian.net/browse/JSSH-71
    
    Remove PaserPool's doDestroy method.  This just worked to hurry up
    the GC of some SoftReferences
---
 .../shared/xml/impl/BasicParserPool.java           |   7 --
 .../shared/xml/impl/BasicParserPoolTest.java       | 129 ---------------------
 2 files changed, 136 deletions(-)

diff --git a/shib-support/src/main/java/net/shibboleth/shared/xml/impl/BasicParserPool.java b/shib-support/src/main/java/net/shibboleth/shared/xml/impl/BasicParserPool.java
index 32c9bd2a..9723c3ee 100644
--- a/shib-support/src/main/java/net/shibboleth/shared/xml/impl/BasicParserPool.java
+++ b/shib-support/src/main/java/net/shibboleth/shared/xml/impl/BasicParserPool.java
@@ -657,13 +657,6 @@ public class BasicParserPool extends AbstractInitializableComponent implements P
         }
     }
 
-    /** {@inheritDoc} */
-    @Override
-    protected void doDestroy() {
-        builderPool.clear();
-        super.doDestroy();
-    }
-    
     /**
      * Build the default set of parser features to use.
      * 
diff --git a/shib-support/src/test/java/net/shibboleth/shared/xml/impl/BasicParserPoolTest.java b/shib-support/src/test/java/net/shibboleth/shared/xml/impl/BasicParserPoolTest.java
index dc2e06d9..723ca470 100644
--- a/shib-support/src/test/java/net/shibboleth/shared/xml/impl/BasicParserPoolTest.java
+++ b/shib-support/src/test/java/net/shibboleth/shared/xml/impl/BasicParserPoolTest.java
@@ -33,7 +33,6 @@ import javax.xml.validation.Schema;
 
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
 import net.shibboleth.shared.component.ComponentInitializationException;
-import net.shibboleth.shared.component.DestroyedComponentException;
 import net.shibboleth.shared.component.UninitializedComponentException;
 import net.shibboleth.shared.component.UnmodifiableComponentException;
 import net.shibboleth.shared.logic.ConstraintViolationException;
@@ -341,134 +340,6 @@ public class BasicParserPoolTest {
         }
         Assert.assertFalse(thrown, "double initialize after init");
 
-        basicParserPool.destroy();
-    }
-
-    @Test public void testDestroy() throws ComponentInitializationException, SAXException, IOException {
-        BasicParserPool pool = new BasicParserPool();
-        pool.destroy();
-
-        Boolean thrown = false;
-        try {
-            pool.initialize();
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        } catch (ComponentInitializationException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "initialize after destroy");
-
-        try {
-            pool.setBuilderAttributes(new HashMap<String, Object>());
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setBuilderAttributes after destroy");
-
-        thrown = false;
-        try {
-            pool.setBuilderFeatures(new HashMap<String, Boolean>());
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setBuilderFeatures after destroy");
-
-        thrown = false;
-
-        try {
-            pool.setCoalescing(true);
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setCoalescing after destroy");
-
-        thrown = false;
-        try {
-            pool.setDTDValidating(true);
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setDTDValidating after destroy");
-
-        thrown = false;
-        try {
-            pool.setExpandEntityReferences(true);
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setExpandEntityReferences after destroy");
-
-        thrown = false;
-        try {
-            pool.setIgnoreComments(true);
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setIgnoreComments after destroy");
-
-        thrown = false;
-        try {
-            pool.setIgnoreElementContentWhitespace(true);
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setIgnoreElementContentWhitespace after destroy");
-
-        thrown = false;
-        try {
-            pool.setNamespaceAware(true);
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setNamespaceAware after destroy");
-
-        final Schema schema;
-        try (final InputStream s = getClass().getResourceAsStream(SCHEMA_FILE)) {
-            final SchemaBuilder schemaBuilder = new SchemaBuilder();
-            schemaBuilder.addSchema(s);
-            schema = schemaBuilder.buildSchema();
-        }
-
-        thrown = false;
-        try {
-            pool.setSchema(schema);
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setSchema after destroy");
-
-        thrown = false;
-        try {
-            pool.setXincludeAware(true);
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setXincludeAware after destroy");
-
-        thrown = false;
-        try {
-            pool.setEntityResolver(new MockEntityResolver());
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setEntityResolver after destroy");
-
-        thrown = false;
-        try {
-            pool.setErrorHandler(new MockErrorHandler());
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "setErrorHandler after destroy");
-
-        thrown = false;
-        try {
-            pool.initialize();
-        } catch (DestroyedComponentException e) {
-            thrown = true;
-        }
-        Assert.assertTrue(thrown, "double initialize after destroy");
-
     }
     
     private void checkParsedDocument(Document document) {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list