Skip to content

Commit fea8484

Browse files
committed
Address PMD warnings
1 parent cf4cfc0 commit fea8484

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

datamodel/openapi/openapi-core-apache/src/main/java/com/sap/cloud/sdk/services/openapi/apache/apiclient/ClassicRequestFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ static ClassicRequestBuilder buildClassicRequest(
9999

100100
final String url = buildUrl(basePath, path, queryParams, collectionQueryParams, urlQueryDeepObject);
101101
final ContentType contentTypeObj = getContentType(contentType);
102+
103+
@SuppressWarnings( "PMD.CloseResource" ) // constructed entity is not a closeable resource
102104
final HttpEntity entity = createEntity(method, body, formParams, contentTypeObj, headerParams, objectMapper);
103105

104106
final ClassicRequestBuilder builder = ClassicRequestBuilder.create(method);
@@ -231,7 +233,7 @@ private static HttpEntity serializeJson(
231233
if( "gzip".equalsIgnoreCase(headerParams.get(CONTENT_ENCODING))
232234
|| "gzip".equalsIgnoreCase(headerParams.get(CONTENT_ENCODING.toLowerCase())) ) {
233235
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
234-
try( final GZIPOutputStream gzip = new GZIPOutputStream(outputStream) ) {
236+
try( GZIPOutputStream gzip = new GZIPOutputStream(outputStream) ) {
235237
gzip.write(objectMapper.writeValueAsBytes(body));
236238
}
237239
catch( final IOException e ) {

0 commit comments

Comments
 (0)