diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache index 0661db1e0ce8..854d8a6cd9af 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/ApiClient.mustache @@ -444,7 +444,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param userAgent User agent * @return API client */ - public ApiClient setUserAgent(String userAgent) { + public final ApiClient setUserAgent(String userAgent) { addDefaultHeader("User-Agent", userAgent); return this; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index 730e975f7390..a8bede35507c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -207,7 +207,7 @@ public class ApiClient { return HttpClient.newBuilder(); } - public void updateBaseUri(String baseUri) { + public final void updateBaseUri(String baseUri) { URI uri = URI.create(baseUri); scheme = uri.getScheme(); host = uri.getHost(); diff --git a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java index 0cb6e8752cf9..790a5abb4bbe 100644 --- a/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/echo_api/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java @@ -362,7 +362,7 @@ public ApiClient setPassword(String password) { * @param userAgent User agent * @return API client */ - public ApiClient setUserAgent(String userAgent) { + public final ApiClient setUserAgent(String userAgent) { addDefaultHeader("User-Agent", userAgent); return this; } diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java index 96f20b81867f..3d56f0aec841 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -214,7 +214,7 @@ public static HttpClient.Builder createDefaultHttpClientBuilder() { return HttpClient.newBuilder(); } - public void updateBaseUri(String baseUri) { + public final void updateBaseUri(String baseUri) { URI uri = URI.create(baseUri); scheme = uri.getScheme(); host = uri.getHost(); diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java index e3d2130be93b..6d3f3bbcac87 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/ApiClient.java @@ -455,7 +455,7 @@ public ApiClient setAccessToken(String accessToken) { * @param userAgent User agent * @return API client */ - public ApiClient setUserAgent(String userAgent) { + public final ApiClient setUserAgent(String userAgent) { addDefaultHeader("User-Agent", userAgent); return this; } diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java index 261cbe1e06f8..642ff1194ca3 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java @@ -214,7 +214,7 @@ public static HttpClient.Builder createDefaultHttpClientBuilder() { return HttpClient.newBuilder(); } - public void updateBaseUri(String baseUri) { + public final void updateBaseUri(String baseUri) { URI uri = URI.create(baseUri); scheme = uri.getScheme(); host = uri.getHost(); diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java index 28c477f8407d..6e57722f0337 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java @@ -214,7 +214,7 @@ public static HttpClient.Builder createDefaultHttpClientBuilder() { return HttpClient.newBuilder(); } - public void updateBaseUri(String baseUri) { + public final void updateBaseUri(String baseUri) { URI uri = URI.create(baseUri); scheme = uri.getScheme(); host = uri.getHost(); diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java index 261cbe1e06f8..642ff1194ca3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -214,7 +214,7 @@ public static HttpClient.Builder createDefaultHttpClientBuilder() { return HttpClient.newBuilder(); } - public void updateBaseUri(String baseUri) { + public final void updateBaseUri(String baseUri) { URI uri = URI.create(baseUri); scheme = uri.getScheme(); host = uri.getHost();