1616
1717package org .springframework .session .aot .hint ;
1818
19+ import java .net .URL ;
20+ import java .time .Duration ;
21+ import java .time .Instant ;
1922import java .util .ArrayList ;
2023import java .util .Arrays ;
24+ import java .util .HashMap ;
25+ import java .util .HashSet ;
26+ import java .util .LinkedHashMap ;
27+ import java .util .LinkedHashSet ;
2128import java .util .TreeSet ;
2229
2330import org .springframework .aot .hint .RuntimeHints ;
2431import org .springframework .aot .hint .RuntimeHintsRegistrar ;
2532import org .springframework .aot .hint .TypeReference ;
33+ import org .springframework .session .MapSession ;
2634
2735/**
2836 * A {@link RuntimeHintsRegistrar} for common session hints.
@@ -33,16 +41,19 @@ class CommonSessionRuntimeHints implements RuntimeHintsRegistrar {
3341
3442 @ Override
3543 public void registerHints (RuntimeHints hints , ClassLoader classLoader ) {
36- Arrays
37- .asList (TypeReference .of (String .class ), TypeReference .of (ArrayList .class ), TypeReference .of (TreeSet .class ),
38- TypeReference .of (Number .class ), TypeReference .of (Long .class ), TypeReference .of (Integer .class ),
39- TypeReference .of (StackTraceElement .class ), TypeReference .of (Throwable .class ),
40- TypeReference .of (Exception .class ), TypeReference .of (RuntimeException .class ),
41- TypeReference .of ("java.util.Collections$UnmodifiableCollection" ),
42- TypeReference .of ("java.util.Collections$UnmodifiableList" ),
43- TypeReference .of ("java.util.Collections$EmptyList" ),
44- TypeReference .of ("java.util.Collections$UnmodifiableRandomAccessList" ),
45- TypeReference .of ("java.util.Collections$UnmodifiableSet" ))
44+ Arrays .asList (TypeReference .of (String .class ), TypeReference .of (Number .class ), TypeReference .of (Long .class ),
45+ TypeReference .of (Integer .class ), TypeReference .of (URL .class ), TypeReference .of (Instant .class ),
46+ TypeReference .of (Duration .class ), TypeReference .of ("java.time.Ser" ),
47+ TypeReference .of (StackTraceElement .class ), TypeReference .of (Throwable .class ),
48+ TypeReference .of (Exception .class ), TypeReference .of (RuntimeException .class ),
49+ TypeReference .of (ArrayList .class ), TypeReference .of (TreeSet .class ), TypeReference .of (HashMap .class ),
50+ TypeReference .of (LinkedHashMap .class ), TypeReference .of (HashSet .class ),
51+ TypeReference .of (LinkedHashSet .class ), TypeReference .of ("java.util.Collections$UnmodifiableCollection" ),
52+ TypeReference .of ("java.util.Collections$UnmodifiableList" ),
53+ TypeReference .of ("java.util.Collections$EmptyList" ),
54+ TypeReference .of ("java.util.Collections$UnmodifiableRandomAccessList" ),
55+ TypeReference .of ("java.util.Collections$UnmodifiableSet" ),
56+ TypeReference .of ("java.util.Collections$UnmodifiableMap" ), TypeReference .of (MapSession .class ))
4657 .forEach (hints .serialization ()::registerType );
4758 }
4859
0 commit comments