From 0f1d3699a2057b0d61b7409d8f649946ecfe7c95 Mon Sep 17 00:00:00 2001 From: Jeff Trent Date: Thu, 5 Oct 2023 10:47:22 -0400 Subject: [PATCH] review comment --- .../main/java/io/helidon/common/tls/spi/TlsManagerCache.java | 5 +++-- .../java/io/helidon/common/tls/spi/TlsManagerProvider.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/tls/src/main/java/io/helidon/common/tls/spi/TlsManagerCache.java b/common/tls/src/main/java/io/helidon/common/tls/spi/TlsManagerCache.java index 98c2746c1b7..9bc8acc9d66 100644 --- a/common/tls/src/main/java/io/helidon/common/tls/spi/TlsManagerCache.java +++ b/common/tls/src/main/java/io/helidon/common/tls/spi/TlsManagerCache.java @@ -28,11 +28,12 @@ class TlsManagerCache { private TlsManagerCache() { } + @SuppressWarnings("unchecked") static TlsManager getOrCreate(T configBean, - Function creator) { + Function creator) { Objects.requireNonNull(configBean); Objects.requireNonNull(creator); - return CACHE.computeIfAbsent(configBean, creator); + return CACHE.computeIfAbsent(configBean, (Function) creator); } } diff --git a/common/tls/src/main/java/io/helidon/common/tls/spi/TlsManagerProvider.java b/common/tls/src/main/java/io/helidon/common/tls/spi/TlsManagerProvider.java index bf3e2810630..e89173eba14 100644 --- a/common/tls/src/main/java/io/helidon/common/tls/spi/TlsManagerProvider.java +++ b/common/tls/src/main/java/io/helidon/common/tls/spi/TlsManagerProvider.java @@ -36,7 +36,7 @@ public interface TlsManagerProvider extends ConfiguredProvider { * @return the tls manager instance from cache, defaulting to creation from the {@code creator} if not in cache */ static TlsManager getOrCreate(T configBean, - Function creator) { + Function creator) { return TlsManagerCache.getOrCreate(configBean, creator); }