Skip to content

Commit 2d4b1c2

Browse files
committed
fix(core): add missing common serialization hints
1 parent 614a67b commit 2d4b1c2

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

spring-session-core/src/main/java/org/springframework/session/aot/hint/CommonSessionRuntimeHints.java

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,21 @@
1616

1717
package org.springframework.session.aot.hint;
1818

19+
import java.net.URL;
20+
import java.time.Duration;
21+
import java.time.Instant;
1922
import java.util.ArrayList;
2023
import java.util.Arrays;
24+
import java.util.HashMap;
25+
import java.util.HashSet;
26+
import java.util.LinkedHashMap;
27+
import java.util.LinkedHashSet;
2128
import java.util.TreeSet;
2229

2330
import org.springframework.aot.hint.RuntimeHints;
2431
import org.springframework.aot.hint.RuntimeHintsRegistrar;
2532
import 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

Comments
 (0)