[java-shib-attribute] branch main updated: JSSH-5 ServiceableComponent should implement AutoClose

Rod Widdowson rdw at steadingsoftware.com
Thu Sep 29 13:33:28 UTC 2022


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

rdw pushed a commit to branch main
in repository java-shib-attribute.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-attribute.git;a=commit;h=36d9f7894ba48d72db629ba5feac58046a38f76d

The following commit(s) were added to refs/heads/main by this push:
     new 36d9f7894 JSSH-5 ServiceableComponent should implement AutoClose
36d9f7894 is described below

commit 36d9f7894ba48d72db629ba5feac58046a38f76d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Sep 29 14:31:38 2022 +0100

    JSSH-5 ServiceableComponent should implement AutoClose
    
    https://shibboleth.atlassian.net/browse/JSSH-5
    
    Use auto close rather than manually unpinning things.
---
 .../net/shibboleth/idp/attribute/resolver/spring/IdP1676Test.java | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/IdP1676Test.java b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/IdP1676Test.java
index a8b8b5c38..cba278502 100644
--- a/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/IdP1676Test.java
+++ b/shib-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/IdP1676Test.java
@@ -141,14 +141,8 @@ public class IdP1676Test extends OpenSAMLInitBaseTestCase {
     private void testResolve(ReloadableService<AttributeResolver> resolverService, int attributeCount) throws ResolutionException {
         final AttributeResolutionContext resolutionContext =
                 TestSources.createResolutionContext("PETER_THE_PRINCIPAL", "issuer", "recipient");
-        ServiceableComponent<AttributeResolver> serviceableComponent = null;
-        try {
-            serviceableComponent = resolverService.getServiceableComponent();
+        try (final ServiceableComponent<AttributeResolver> serviceableComponent = resolverService.getServiceableComponent()){
             serviceableComponent.getComponent().resolveAttributes(resolutionContext);
-        } finally {
-            if (null != serviceableComponent) {
-                serviceableComponent.unpinComponent();
-            } 
         }
         assertEquals(resolutionContext.getResolvedIdPAttributes().size(), attributeCount);
         

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


More information about the commits mailing list