Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8327991

Improve HttpClient documentation with regard to reclaiming resources

XMLWordPrintable

    • b16

      The HttpClient class level java doc has an API note about closing a client and reclaiming resource. There should also be an implementation note documenting what happens when a client is garbage collected without being explicitly closed.

      In particular, it may not be obvious that an InputStream always need to be closed, which requires to always call HttpResponse::body() when the body is an InputStream.

      At a minimum, the various BodyHandlers and BodySubscriber whose body need to be closed should link to the API/implementation note in the HttpClient class level documentation.

            dfuchs Daniel Fuchs
            dfuchs Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: