Skip to content

Commit 8091162

Browse files
remove IOException where not thrown anymore
1 parent f118f3f commit 8091162

7 files changed

Lines changed: 44 additions & 44 deletions

File tree

modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ public class {{classname}} {
531531
localVarResponseBody.close();
532532
}
533533
}
534-
} catch (IOException {{#useJackson3}}| JacksonException {{/useJackson3}}e) {
534+
} catch (IOException {{#returnType}}{{#useJackson3}}| JacksonException {{/useJackson3}}{{/returnType}}e) {
535535
throw new ApiException(e);
536536
}
537537
catch (InterruptedException e) {
@@ -618,7 +618,7 @@ public class {{classname}} {
618618
localVarResponseBody.close();
619619
}
620620
}
621-
} catch (IOException {{#useJackson3}}| JacksonException {{/useJackson3}}e) {
621+
} catch (IOException {{#returnType}}{{#useJackson3}}| JacksonException {{/useJackson3}}{{/returnType}}e) {
622622
return CompletableFuture.failedFuture(new ApiException(e));
623623
}
624624
}
@@ -749,7 +749,7 @@ public class {{classname}} {
749749
{{^useGzipFeature}}
750750
localVarRequestBuilder.method("{{httpMethod}}", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
751751
{{/useGzipFeature}}
752-
} catch (IOException {{#useJackson3}}| JacksonException {{/useJackson3}}e) {
752+
} catch ({{^useJackson3}}IOException{{/useJackson3}}{{#useJackson3}}JacksonException{{/useJackson3}} e) {
753753
throw new ApiException(e);
754754
}
755755
{{/isString}}

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ private HttpRequest.Builder call123testSpecialTagsRequestBuilder(@javax.annotati
272272
try {
273273
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client);
274274
localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
275-
} catch (IOException | JacksonException e) {
275+
} catch (JacksonException e) {
276276
throw new ApiException(e);
277277
}
278278
if (memberVarReadTimeout != null) {

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeApi.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ private HttpRequest.Builder fakeOuterBooleanSerializeRequestBuilder(@javax.annot
503503
try {
504504
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
505505
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
506-
} catch (IOException | JacksonException e) {
506+
} catch (JacksonException e) {
507507
throw new ApiException(e);
508508
}
509509
if (memberVarReadTimeout != null) {
@@ -622,7 +622,7 @@ private HttpRequest.Builder fakeOuterCompositeSerializeRequestBuilder(@javax.ann
622622
try {
623623
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(outerComposite);
624624
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
625-
} catch (IOException | JacksonException e) {
625+
} catch (JacksonException e) {
626626
throw new ApiException(e);
627627
}
628628
if (memberVarReadTimeout != null) {
@@ -741,7 +741,7 @@ private HttpRequest.Builder fakeOuterNumberSerializeRequestBuilder(@javax.annota
741741
try {
742742
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);
743743
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
744-
} catch (IOException | JacksonException e) {
744+
} catch (JacksonException e) {
745745
throw new ApiException(e);
746746
}
747747
if (memberVarReadTimeout != null) {
@@ -1155,7 +1155,7 @@ public ApiResponse<Void> testAdditionalPropertiesReferenceWithHttpInfo(@javax.an
11551155
localVarResponseBody.close();
11561156
}
11571157
}
1158-
} catch (IOException | JacksonException e) {
1158+
} catch (IOException e) {
11591159
throw new ApiException(e);
11601160
}
11611161
catch (InterruptedException e) {
@@ -1182,7 +1182,7 @@ private HttpRequest.Builder testAdditionalPropertiesReferenceRequestBuilder(@jav
11821182
try {
11831183
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody);
11841184
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
1185-
} catch (IOException | JacksonException e) {
1185+
} catch (JacksonException e) {
11861186
throw new ApiException(e);
11871187
}
11881188
if (memberVarReadTimeout != null) {
@@ -1264,7 +1264,7 @@ public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(@javax.annotation.No
12641264
localVarResponseBody.close();
12651265
}
12661266
}
1267-
} catch (IOException | JacksonException e) {
1267+
} catch (IOException e) {
12681268
throw new ApiException(e);
12691269
}
12701270
catch (InterruptedException e) {
@@ -1291,7 +1291,7 @@ private HttpRequest.Builder testBodyWithFileSchemaRequestBuilder(@javax.annotati
12911291
try {
12921292
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(fileSchemaTestClass);
12931293
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
1294-
} catch (IOException | JacksonException e) {
1294+
} catch (JacksonException e) {
12951295
throw new ApiException(e);
12961296
}
12971297
if (memberVarReadTimeout != null) {
@@ -1377,7 +1377,7 @@ public ApiResponse<Void> testBodyWithQueryParamsWithHttpInfo(@javax.annotation.N
13771377
localVarResponseBody.close();
13781378
}
13791379
}
1380-
} catch (IOException | JacksonException e) {
1380+
} catch (IOException e) {
13811381
throw new ApiException(e);
13821382
}
13831383
catch (InterruptedException e) {
@@ -1423,7 +1423,7 @@ private HttpRequest.Builder testBodyWithQueryParamsRequestBuilder(@javax.annotat
14231423
try {
14241424
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user);
14251425
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
1426-
} catch (IOException | JacksonException e) {
1426+
} catch (JacksonException e) {
14271427
throw new ApiException(e);
14281428
}
14291429
if (memberVarReadTimeout != null) {
@@ -1546,7 +1546,7 @@ private HttpRequest.Builder testClientModelRequestBuilder(@javax.annotation.Nonn
15461546
try {
15471547
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client);
15481548
localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
1549-
} catch (IOException | JacksonException e) {
1549+
} catch (JacksonException e) {
15501550
throw new ApiException(e);
15511551
}
15521552
if (memberVarReadTimeout != null) {
@@ -1680,7 +1680,7 @@ public ApiResponse<Void> testEndpointParametersWithHttpInfo(@javax.annotation.No
16801680
localVarResponseBody.close();
16811681
}
16821682
}
1683-
} catch (IOException | JacksonException e) {
1683+
} catch (IOException e) {
16841684
throw new ApiException(e);
16851685
}
16861686
catch (InterruptedException e) {
@@ -1877,7 +1877,7 @@ public ApiResponse<Void> testEnumParametersWithHttpInfo(@javax.annotation.Nullab
18771877
localVarResponseBody.close();
18781878
}
18791879
}
1880-
} catch (IOException | JacksonException e) {
1880+
} catch (IOException e) {
18811881
throw new ApiException(e);
18821882
}
18831883
catch (InterruptedException e) {
@@ -2105,7 +2105,7 @@ public ApiResponse<Void> testGroupParametersWithHttpInfo(@javax.annotation.Nonnu
21052105
localVarResponseBody.close();
21062106
}
21072107
}
2108-
} catch (IOException | JacksonException e) {
2108+
} catch (IOException e) {
21092109
throw new ApiException(e);
21102110
}
21112111
catch (InterruptedException e) {
@@ -2332,7 +2332,7 @@ public ApiResponse<Void> testInlineAdditionalPropertiesWithHttpInfo(@javax.annot
23322332
localVarResponseBody.close();
23332333
}
23342334
}
2335-
} catch (IOException | JacksonException e) {
2335+
} catch (IOException e) {
23362336
throw new ApiException(e);
23372337
}
23382338
catch (InterruptedException e) {
@@ -2359,7 +2359,7 @@ private HttpRequest.Builder testInlineAdditionalPropertiesRequestBuilder(@javax.
23592359
try {
23602360
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody);
23612361
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
2362-
} catch (IOException | JacksonException e) {
2362+
} catch (JacksonException e) {
23632363
throw new ApiException(e);
23642364
}
23652365
if (memberVarReadTimeout != null) {
@@ -2441,7 +2441,7 @@ public ApiResponse<Void> testInlineFreeformAdditionalPropertiesWithHttpInfo(@jav
24412441
localVarResponseBody.close();
24422442
}
24432443
}
2444-
} catch (IOException | JacksonException e) {
2444+
} catch (IOException e) {
24452445
throw new ApiException(e);
24462446
}
24472447
catch (InterruptedException e) {
@@ -2468,7 +2468,7 @@ private HttpRequest.Builder testInlineFreeformAdditionalPropertiesRequestBuilder
24682468
try {
24692469
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(testInlineFreeformAdditionalPropertiesRequest);
24702470
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
2471-
} catch (IOException | JacksonException e) {
2471+
} catch (JacksonException e) {
24722472
throw new ApiException(e);
24732473
}
24742474
if (memberVarReadTimeout != null) {
@@ -2554,7 +2554,7 @@ public ApiResponse<Void> testJsonFormDataWithHttpInfo(@javax.annotation.Nonnull
25542554
localVarResponseBody.close();
25552555
}
25562556
}
2557-
} catch (IOException | JacksonException e) {
2557+
} catch (IOException e) {
25582558
throw new ApiException(e);
25592559
}
25602560
catch (InterruptedException e) {
@@ -2695,7 +2695,7 @@ public ApiResponse<Void> testQueryParameterCollectionFormatWithHttpInfo(@javax.a
26952695
localVarResponseBody.close();
26962696
}
26972697
}
2698-
} catch (IOException | JacksonException e) {
2698+
} catch (IOException e) {
26992699
throw new ApiException(e);
27002700
}
27012701
catch (InterruptedException e) {
@@ -2837,7 +2837,7 @@ public ApiResponse<Void> testStringMapReferenceWithHttpInfo(@javax.annotation.No
28372837
localVarResponseBody.close();
28382838
}
28392839
}
2840-
} catch (IOException | JacksonException e) {
2840+
} catch (IOException e) {
28412841
throw new ApiException(e);
28422842
}
28432843
catch (InterruptedException e) {
@@ -2864,7 +2864,7 @@ private HttpRequest.Builder testStringMapReferenceRequestBuilder(@javax.annotati
28642864
try {
28652865
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody);
28662866
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
2867-
} catch (IOException | JacksonException e) {
2867+
} catch (JacksonException e) {
28682868
throw new ApiException(e);
28692869
}
28702870
if (memberVarReadTimeout != null) {

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ private HttpRequest.Builder testClassnameRequestBuilder(@javax.annotation.Nonnul
278278
try {
279279
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client);
280280
localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
281-
} catch (IOException | JacksonException e) {
281+
} catch (JacksonException e) {
282282
throw new ApiException(e);
283283
}
284284
if (memberVarReadTimeout != null) {

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/PetApi.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public ApiResponse<Void> addPetWithHttpInfo(@javax.annotation.Nonnull Pet pet, M
239239
localVarResponseBody.close();
240240
}
241241
}
242-
} catch (IOException | JacksonException e) {
242+
} catch (IOException e) {
243243
throw new ApiException(e);
244244
}
245245
catch (InterruptedException e) {
@@ -266,7 +266,7 @@ private HttpRequest.Builder addPetRequestBuilder(@javax.annotation.Nonnull Pet p
266266
try {
267267
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet);
268268
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
269-
} catch (IOException | JacksonException e) {
269+
} catch (JacksonException e) {
270270
throw new ApiException(e);
271271
}
272272
if (memberVarReadTimeout != null) {
@@ -352,7 +352,7 @@ public ApiResponse<Void> deletePetWithHttpInfo(@javax.annotation.Nonnull Long pe
352352
localVarResponseBody.close();
353353
}
354354
}
355-
} catch (IOException | JacksonException e) {
355+
} catch (IOException e) {
356356
throw new ApiException(e);
357357
}
358358
catch (InterruptedException e) {
@@ -849,7 +849,7 @@ public ApiResponse<Void> updatePetWithHttpInfo(@javax.annotation.Nonnull Pet pet
849849
localVarResponseBody.close();
850850
}
851851
}
852-
} catch (IOException | JacksonException e) {
852+
} catch (IOException e) {
853853
throw new ApiException(e);
854854
}
855855
catch (InterruptedException e) {
@@ -876,7 +876,7 @@ private HttpRequest.Builder updatePetRequestBuilder(@javax.annotation.Nonnull Pe
876876
try {
877877
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet);
878878
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
879-
} catch (IOException | JacksonException e) {
879+
} catch (JacksonException e) {
880880
throw new ApiException(e);
881881
}
882882
if (memberVarReadTimeout != null) {
@@ -966,7 +966,7 @@ public ApiResponse<Void> updatePetWithFormWithHttpInfo(@javax.annotation.Nonnull
966966
localVarResponseBody.close();
967967
}
968968
}
969-
} catch (IOException | JacksonException e) {
969+
} catch (IOException e) {
970970
throw new ApiException(e);
971971
}
972972
catch (InterruptedException e) {

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/StoreApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public ApiResponse<Void> deleteOrderWithHttpInfo(@javax.annotation.Nonnull Strin
237237
localVarResponseBody.close();
238238
}
239239
}
240-
} catch (IOException | JacksonException e) {
240+
} catch (IOException e) {
241241
throw new ApiException(e);
242242
}
243243
catch (InterruptedException e) {
@@ -609,7 +609,7 @@ private HttpRequest.Builder placeOrderRequestBuilder(@javax.annotation.Nonnull O
609609
try {
610610
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(order);
611611
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
612-
} catch (IOException | JacksonException e) {
612+
} catch (JacksonException e) {
613613
throw new ApiException(e);
614614
}
615615
if (memberVarReadTimeout != null) {

samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/UserApi.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public ApiResponse<Void> createUserWithHttpInfo(@javax.annotation.Nonnull User u
238238
localVarResponseBody.close();
239239
}
240240
}
241-
} catch (IOException | JacksonException e) {
241+
} catch (IOException e) {
242242
throw new ApiException(e);
243243
}
244244
catch (InterruptedException e) {
@@ -265,7 +265,7 @@ private HttpRequest.Builder createUserRequestBuilder(@javax.annotation.Nonnull U
265265
try {
266266
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user);
267267
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
268-
} catch (IOException | JacksonException e) {
268+
} catch (JacksonException e) {
269269
throw new ApiException(e);
270270
}
271271
if (memberVarReadTimeout != null) {
@@ -347,7 +347,7 @@ public ApiResponse<Void> createUsersWithArrayInputWithHttpInfo(@javax.annotation
347347
localVarResponseBody.close();
348348
}
349349
}
350-
} catch (IOException | JacksonException e) {
350+
} catch (IOException e) {
351351
throw new ApiException(e);
352352
}
353353
catch (InterruptedException e) {
@@ -374,7 +374,7 @@ private HttpRequest.Builder createUsersWithArrayInputRequestBuilder(@javax.annot
374374
try {
375375
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user);
376376
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
377-
} catch (IOException | JacksonException e) {
377+
} catch (JacksonException e) {
378378
throw new ApiException(e);
379379
}
380380
if (memberVarReadTimeout != null) {
@@ -456,7 +456,7 @@ public ApiResponse<Void> createUsersWithListInputWithHttpInfo(@javax.annotation.
456456
localVarResponseBody.close();
457457
}
458458
}
459-
} catch (IOException | JacksonException e) {
459+
} catch (IOException e) {
460460
throw new ApiException(e);
461461
}
462462
catch (InterruptedException e) {
@@ -483,7 +483,7 @@ private HttpRequest.Builder createUsersWithListInputRequestBuilder(@javax.annota
483483
try {
484484
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user);
485485
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
486-
} catch (IOException | JacksonException e) {
486+
} catch (JacksonException e) {
487487
throw new ApiException(e);
488488
}
489489
if (memberVarReadTimeout != null) {
@@ -565,7 +565,7 @@ public ApiResponse<Void> deleteUserWithHttpInfo(@javax.annotation.Nonnull String
565565
localVarResponseBody.close();
566566
}
567567
}
568-
} catch (IOException | JacksonException e) {
568+
} catch (IOException e) {
569569
throw new ApiException(e);
570570
}
571571
catch (InterruptedException e) {
@@ -925,7 +925,7 @@ public ApiResponse<Void> logoutUserWithHttpInfo(Map<String, String> headers) thr
925925
localVarResponseBody.close();
926926
}
927927
}
928-
} catch (IOException | JacksonException e) {
928+
} catch (IOException e) {
929929
throw new ApiException(e);
930930
}
931931
catch (InterruptedException e) {
@@ -1028,7 +1028,7 @@ public ApiResponse<Void> updateUserWithHttpInfo(@javax.annotation.Nonnull String
10281028
localVarResponseBody.close();
10291029
}
10301030
}
1031-
} catch (IOException | JacksonException e) {
1031+
} catch (IOException e) {
10321032
throw new ApiException(e);
10331033
}
10341034
catch (InterruptedException e) {
@@ -1060,7 +1060,7 @@ private HttpRequest.Builder updateUserRequestBuilder(@javax.annotation.Nonnull S
10601060
try {
10611061
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user);
10621062
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
1063-
} catch (IOException | JacksonException e) {
1063+
} catch (JacksonException e) {
10641064
throw new ApiException(e);
10651065
}
10661066
if (memberVarReadTimeout != null) {

0 commit comments

Comments
 (0)