From 8619713936bd77f938c48c7eeeaf28630a391b26 Mon Sep 17 00:00:00 2001 From: Tim Grein Date: Thu, 6 Jun 2024 15:30:47 +0200 Subject: [PATCH] [Inference API] Make ServiceUtils final and add private constructor (#109426) --- .../elasticsearch/xpack/inference/services/ServiceUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ServiceUtils.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ServiceUtils.java index 4b5ec48f99b74..6d4b6d35323fd 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ServiceUtils.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ServiceUtils.java @@ -39,7 +39,7 @@ import static org.elasticsearch.core.Strings.format; import static org.elasticsearch.xpack.inference.services.ServiceFields.SIMILARITY; -public class ServiceUtils { +public final class ServiceUtils { /** * Remove the object from the map and cast to the expected type. * If the object cannot be cast to type an ElasticsearchStatusException @@ -624,4 +624,6 @@ public static SecureString apiKey(@Nullable ApiKeySecrets secrets) { // To avoid a possible null pointer throughout the code we'll create a noop api key of an empty array return secrets == null ? new SecureString(new char[0]) : secrets.apiKey(); } + + private ServiceUtils() {} }