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

Scott Cantor cantor.2 at osu.edu
Mon Aug 28 17:48:03 UTC 2023


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

scantor pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=2df33e55808c00cfa974c3d49711979941acc399

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

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

    All HttpResponse types are not closeable, no need to cast.
---
 .../net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java  | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java
index e60122629..7bf4434b7 100644
--- a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java
+++ b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java
@@ -43,7 +43,6 @@ import net.shibboleth.shared.resolver.CriteriaSet;
 import org.apache.hc.client5.http.ClientProtocolException;
 import org.apache.hc.client5.http.classic.HttpClient;
 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;
 
@@ -177,9 +176,9 @@ public class HttpClientProxyValidator implements ProxyValidator {
         } catch (final IOException e) {
             throw new GeneralSecurityException("IO error", e);
         } 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