[ 
https://issues.apache.org/jira/browse/JENA-1335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16004803#comment-16004803
 ] 

A. Soroka edited comment on JENA-1335 at 5/10/17 2:47 PM:
----------------------------------------------------------

Yes, {{CloseableHttpClient}} is frankly, a pain in the neck. I just had to deal 
with the same confusion in another project. It's an abstract class. Every 
client you get from the API (via {{HttpClientBuilder}} _is_ a 
{{CloseableHttpClient}} but they all are actually returned as a plain 
{{HttpClient}}. Only {{CloseableHttpClient}} returns {{CloseableHttpResponse}} 
s, but the only way you can get them is to cast the client. It's confusing at 
best. I hope they improve it in v5.

That comment is referring to the obsolete idea that if a client was given to 
Jena we should not close it because it might be in use elsewhere whereas if we 
built one we should close it after use. That was wrong-- we didn't understand 
that {{HttpClient}} is thread-safe and meant for reuse. That comment should go.


was (Author: ajs6f):
Yes, {{CloseableHttpClient}} is frankly, a pain in the neck. I just had to deal 
with the same confusion in another project. It's an abstract class. Every 
client you get from the API (via {{HttpClientBuilder}} _is_ a 
{{CloseableHttpClient}} but they all are actually returned as a plain 
{{HttpClient}}. Only {{CloseableHttpClient}} returns 
{{CloseableHttpResponse}}s, but the only way you can get them is to cast. It's 
confusing at best. I hope they improve it in v5.

That comment is referring to the obsolete idea that if a client was given to 
Jena we should not close it because it might be in use elsewhere whereas if we 
built one we should close it after use. That was wrong-- we didn't understand 
that {{HttpClient}} is thread-safe and meant for reuse. That comment should go.

> HttpOp does not close HttpResponses.
> ------------------------------------
>
>                 Key: JENA-1335
>                 URL: https://issues.apache.org/jira/browse/JENA-1335
>             Project: Apache Jena
>          Issue Type: Bug
>    Affects Versions: Jena 3.3.0
>            Reporter: Andy Seaborne
>
> From 
> https://lists.apache.org/thread.html/d38ee72f8aabbebc86154fa5915ec14009b38d2c815146470034921a@%3Cusers.jena.apache.org%3E



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to