Fix BindingReflectionHintsRegistrar enum support
This commit prevents a StackOverflowError in BindingReflectionHintsRegistrar when processing enum types and refine related generated hints. See gh-28683
This commit is contained in:
@@ -196,6 +196,13 @@ public class BindingReflectionHintsRegistrarTests {
|
||||
typeHint -> assertThat(typeHint.getType()).isEqualTo(TypeReference.of(Set.class)));
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerTypeForSerializationWithEnum() {
|
||||
bindingRegistrar.registerReflectionHints(this.hints.reflection(), SampleEnum.class);
|
||||
assertThat(this.hints.reflection().typeHints()).singleElement()
|
||||
.satisfies(typeHint -> assertThat(typeHint.getType()).isEqualTo(TypeReference.of(SampleEnum.class)));
|
||||
}
|
||||
|
||||
|
||||
static class SampleEmptyClass {
|
||||
}
|
||||
@@ -274,4 +281,8 @@ public class BindingReflectionHintsRegistrarTests {
|
||||
}
|
||||
}
|
||||
|
||||
enum SampleEnum {
|
||||
value1, value2
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user