|
1 | 1 | /* |
2 | | - * Copyright 2022 the original author or authors. |
| 2 | + * Copyright 2022-2023 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
34 | 34 | import org.springframework.aot.hint.RuntimeHints; |
35 | 35 | import org.springframework.aot.hint.RuntimeHintsRegistrar; |
36 | 36 | import org.springframework.aot.hint.SerializationHints; |
37 | | -import org.springframework.aot.hint.TypeReference; |
38 | 37 | import org.springframework.beans.factory.config.BeanExpressionContext; |
39 | 38 | import org.springframework.context.SmartLifecycle; |
40 | 39 | import org.springframework.integration.aggregator.MessageGroupProcessor; |
|
66 | 65 | import org.springframework.messaging.ReactiveMessageHandler; |
67 | 66 | import org.springframework.messaging.support.ErrorMessage; |
68 | 67 | import org.springframework.messaging.support.GenericMessage; |
| 68 | +import org.springframework.util.ClassUtils; |
69 | 69 | import org.springframework.util.ReflectionUtils; |
70 | 70 |
|
71 | 71 | /** |
@@ -96,10 +96,10 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) { |
96 | 96 | Pausable.class) |
97 | 97 | .forEach(type -> reflectionHints.registerType(type, MemberCategory.INVOKE_PUBLIC_METHODS)); |
98 | 98 |
|
99 | | - reflectionHints.registerType(JsonPathUtils.class, |
100 | | - builder -> |
101 | | - builder.onReachableType(TypeReference.of("com.jayway.jsonpath.JsonPath")) |
102 | | - .withMembers(MemberCategory.INVOKE_PUBLIC_METHODS)); |
| 99 | + |
| 100 | + if (ClassUtils.isPresent("com.jayway.jsonpath.JsonPath", classLoader)) { |
| 101 | + reflectionHints.registerType(JsonPathUtils.class, MemberCategory.INVOKE_PUBLIC_METHODS); |
| 102 | + } |
103 | 103 |
|
104 | 104 | // For #xpath() SpEL function |
105 | 105 | reflectionHints.registerTypeIfPresent(classLoader, "org.springframework.integration.xml.xpath.XPathUtils", |
|
0 commit comments