21
21
import java .util .List ;
22
22
23
23
import org .springframework .aot .hint .ExecutableMode ;
24
+ import org .springframework .aot .hint .MemberCategory ;
25
+ import org .springframework .aot .hint .ReflectionHints ;
24
26
import org .springframework .aot .hint .RuntimeHints ;
25
27
import org .springframework .aot .hint .RuntimeHintsRegistrar ;
26
28
import org .springframework .aot .hint .TypeReference ;
@@ -37,15 +39,17 @@ class ObjectToObjectConverterRuntimeHints implements RuntimeHintsRegistrar {
37
39
38
40
@ Override
39
41
public void registerHints (RuntimeHints hints , @ Nullable ClassLoader classLoader ) {
42
+ ReflectionHints reflectionHints = hints .reflection ();
40
43
TypeReference sqlDateTypeReference = TypeReference .of ("java.sql.Date" );
41
- hints . reflection () .registerTypeIfPresent (classLoader , sqlDateTypeReference .getName (), hint -> hint
44
+ reflectionHints .registerTypeIfPresent (classLoader , sqlDateTypeReference .getName (), hint -> hint
42
45
.withMethod ("toLocalDate" , Collections .emptyList (), ExecutableMode .INVOKE )
43
46
.onReachableType (sqlDateTypeReference )
44
47
.withMethod ("valueOf" , List .of (TypeReference .of (LocalDate .class )), ExecutableMode .INVOKE )
45
48
.onReachableType (sqlDateTypeReference ));
46
49
47
- hints . reflection () .registerTypeIfPresent (classLoader , "org.springframework.http.HttpMethod" ,
50
+ reflectionHints .registerTypeIfPresent (classLoader , "org.springframework.http.HttpMethod" ,
48
51
builder -> builder .withMethod ("valueOf" , List .of (TypeReference .of (String .class )), ExecutableMode .INVOKE ));
52
+ reflectionHints .registerTypeIfPresent (classLoader , "java.net.URI" , MemberCategory .INVOKE_DECLARED_CONSTRUCTORS );
49
53
}
50
54
51
55
}
0 commit comments