[java-shib-profile] branch main updated: All HttpResponse types are not closeable, no need to cast.

Scott Cantor cantor.2 at osu.edu
Mon Aug 28 17:47:41 UTC 2023


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

scantor pushed a commit to branch main
in repository java-shib-profile.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-profile.git;a=commit;h=741205497a0c03b770649af83f4b3284e4fb03ea

The following commit(s) were added to refs/heads/main by this push:
     new 7412054  All HttpResponse types are not closeable, no need to cast.
7412054 is described below

commit 741205497a0c03b770649af83f4b3284e4fb03ea
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Aug 28 13:47:17 2023 -0400

    All HttpResponse types are not closeable, no need to cast.
---
 .../src/main/java/net/shibboleth/profile/module/AbstractModule.java  | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/shib-profile-api/src/main/java/net/shibboleth/profile/module/AbstractModule.java b/shib-profile-api/src/main/java/net/shibboleth/profile/module/AbstractModule.java
index 6984acb..fdcdffd 100644
--- a/shib-profile-api/src/main/java/net/shibboleth/profile/module/AbstractModule.java
+++ b/shib-profile-api/src/main/java/net/shibboleth/profile/module/AbstractModule.java
@@ -39,7 +39,6 @@ import javax.annotation.Nullable;
 import org.apache.commons.lang3.SystemUtils;
 
 import org.apache.hc.client5.http.classic.methods.HttpGet;
-import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
 import org.apache.hc.client5.http.protocol.HttpClientContext;
 import org.apache.hc.core5.http.ClassicHttpResponse;
 import org.opensaml.security.httpclient.HttpClientSecuritySupport;
@@ -444,9 +443,9 @@ public abstract class AbstractModule implements Module {
                 response = null;
                 return ret;
             } finally {
-                if (response != null && CloseableHttpResponse.class.isInstance(response)) {
+                if (response != null) {
                     try {
-                        CloseableHttpResponse.class.cast(response).close();
+                        response.close();
                     } catch (final IOException e) {
                         log.debug("Error closing HttpResponse", e);
                     }

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


More information about the commits mailing list