heremaps / oksse

An extension library for OkHttp to create a Server-Sent Event (SSE) client.
Apache License 2.0
232 stars 27 forks source link

Added try-with-resources clause to response body handling #24

Closed bruestel closed 6 years ago

bruestel commented 6 years ago

Prevent warning about leaked connection (' A connection to https://xyz.com/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger. getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);').

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

marcelpinto commented 6 years ago

Could you explain why the try would fix that? Shouldn't it have a finally and then close the source?

marcelpinto commented 6 years ago

Oh I see now that is a try with resources and I guess the body implements autoclose. I was checking it with my mobile and did not see it