From 0a6808441b63b4fe6c7ea51d2b1e7e9c5ec1e916 Mon Sep 17 00:00:00 2001 From: Soby Chacko Date: Thu, 17 Nov 2022 15:35:33 -0500 Subject: [PATCH] Move hint for Flux using registerTypeIfAvailable --- .../springframework/pulsar/aot/PulsarRuntimeHints.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spring-pulsar/src/main/java/org/springframework/pulsar/aot/PulsarRuntimeHints.java b/spring-pulsar/src/main/java/org/springframework/pulsar/aot/PulsarRuntimeHints.java index 828722fb..d1bc4886 100644 --- a/spring-pulsar/src/main/java/org/springframework/pulsar/aot/PulsarRuntimeHints.java +++ b/spring-pulsar/src/main/java/org/springframework/pulsar/aot/PulsarRuntimeHints.java @@ -41,8 +41,6 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar; import org.springframework.aot.hint.TypeReference; import org.springframework.lang.Nullable; -import reactor.core.publisher.Flux; - /** * {@link RuntimeHintsRegistrar} for Spring for Apache Pulsar. * @@ -61,7 +59,7 @@ public class PulsarRuntimeHints implements RuntimeHintsRegistrar { Stream.of(HashSet.class, TreeMap.class, Authentication.class, AuthenticationDataProvider.class, SecretsSerializer.class, NioSocketChannel.class, AbstractByteBufAllocator.class, NioDatagramChannel.class, PulsarAdminBuilderImpl.class, OffloadProcessStatusImpl.class, Commands.class, - ReferenceCountUtil.class, Flux.class).forEach( + ReferenceCountUtil.class).forEach( type -> reflectionHints.registerType(type, builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_METHODS, @@ -88,8 +86,8 @@ public class PulsarRuntimeHints implements RuntimeHintsRegistrar { .forEach(typeName -> reflectionHints.registerTypeIfPresent(classLoader, typeName, MemberCategory.DECLARED_FIELDS)); - // Dynamic components that need hints with constructor and method level access. - Stream.of("com.github.benmanes.caffeine.cache.SSMSA", "com.github.benmanes.caffeine.cache.PSAMS") + Stream.of("reactor.core.publisher.Flux", "com.github.benmanes.caffeine.cache.SSMSA", + "com.github.benmanes.caffeine.cache.PSAMS") .forEach(typeName -> reflectionHints.registerTypeIfPresent(classLoader, typeName, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.INTROSPECT_PUBLIC_METHODS));