Skip to content

[JAVA] java/jersey2 ApiClient.invokeAPI doesn´t close the Response object #5777

@Moscagus

Description

@Moscagus
Description

The code does not guarantee the correct closing of the Response object, since it does not always reach a response.readEntity or call a response.readEntity(InputStream.class) that does not close the connection either.
See:
https://jersey.github.io/documentation/latest/client.html#d0e5222

Swagger-codegen version

swagger-codegen-cli-2.2.2.jar

Swagger declaration file content or url
Command line used for generation

-l java --library jersey2

Steps to reproduce
Related issues
Suggest a Fix

...
Response response = null;

try {
if ("GET".equals(method)) {
response = invocationBuilder.get();
...
} finally {
try {
response.close();
} catch (Exception e) {}
}

}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions