From bc92c4a1da6532812b6ae6e10195c73e239b58e1 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Fri, 4 Nov 2022 11:21:37 +0100 Subject: [PATCH] Add native reflection hints for Job/Step contexts --- .../org/springframework/batch/core/aot/CoreRuntimeHints.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/aot/CoreRuntimeHints.java b/spring-batch-core/src/main/java/org/springframework/batch/core/aot/CoreRuntimeHints.java index f044f0335..c2e297461 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/aot/CoreRuntimeHints.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/aot/CoreRuntimeHints.java @@ -23,6 +23,8 @@ import org.springframework.aot.hint.MemberCategory; import org.springframework.aot.hint.RuntimeHints; import org.springframework.aot.hint.RuntimeHintsRegistrar; import org.springframework.aot.hint.TypeReference; +import org.springframework.batch.core.scope.context.JobContext; +import org.springframework.batch.core.scope.context.StepContext; import org.springframework.core.DecoratingProxy; /** @@ -58,6 +60,9 @@ public class CoreRuntimeHints implements RuntimeHintsRegistrar { .proxiedInterfaces(SpringProxy.class, Advised.class, DecoratingProxy.class)); hints.reflection().registerType(Types.class, MemberCategory.DECLARED_FIELDS); + + hints.reflection().registerType(JobContext.class, MemberCategory.INVOKE_PUBLIC_METHODS); + hints.reflection().registerType(StepContext.class, MemberCategory.INVOKE_PUBLIC_METHODS); } }