Skip to content

Commit ffe50d2

Browse files
authored
GH-8613: Add JsonPropertyAccessor type for native (#8614)
Fixes #8613 If `JsonPropertyAccessor` is registered for SpEL, it would be great to have it working in native images as well. Since SpEL is fully based on reflection, expose `JsonPropertyAccessor$ComparableJsonNode` and `JsonPropertyAccessor$ArrayNodeAsList` reflection hints for their method invocations from SpEL **Cherry-pick to `6.0.x`**
1 parent b999ac1 commit ffe50d2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spring-integration-core/src/main/java/org/springframework/integration/aot/CoreRuntimeHints.java

+9
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.springframework.aot.hint.RuntimeHints;
3535
import org.springframework.aot.hint.RuntimeHintsRegistrar;
3636
import org.springframework.aot.hint.SerializationHints;
37+
import org.springframework.aot.hint.TypeReference;
3738
import org.springframework.beans.factory.config.BeanExpressionContext;
3839
import org.springframework.context.SmartLifecycle;
3940
import org.springframework.integration.aggregator.MessageGroupProcessor;
@@ -101,6 +102,14 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
101102
reflectionHints.registerType(JsonPathUtils.class, MemberCategory.INVOKE_PUBLIC_METHODS);
102103
}
103104

105+
reflectionHints.registerType(
106+
TypeReference.of("org.springframework.integration.json.JsonPropertyAccessor$ComparableJsonNode"),
107+
MemberCategory.INVOKE_PUBLIC_METHODS);
108+
109+
reflectionHints.registerType(
110+
TypeReference.of("org.springframework.integration.json.JsonPropertyAccessor$ArrayNodeAsList"),
111+
MemberCategory.INVOKE_PUBLIC_METHODS);
112+
104113
// For #xpath() SpEL function
105114
reflectionHints.registerTypeIfPresent(classLoader, "org.springframework.integration.xml.xpath.XPathUtils",
106115
MemberCategory.INVOKE_PUBLIC_METHODS);

0 commit comments

Comments
 (0)