Fix BindingReflectionHintsRegistrar anonymous classes support
This commit ensures that giving an anonymous class for reflection hints registration does not result in a NullPointerException, since the canonical name of anonymous classes is null. Fixes gh-29657
This commit is contained in:
@@ -221,6 +221,12 @@ public class BindingReflectionHintsRegistrarTests {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerTypeForSerializationWithAnonymousClass() {
|
||||
Runnable anonymousRunnable = () -> { };
|
||||
bindingRegistrar.registerReflectionHints(this.hints.reflection(), anonymousRunnable.getClass());
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerTypeForJacksonAnnotations() {
|
||||
bindingRegistrar.registerReflectionHints(this.hints.reflection(), SampleClassWithJsonProperty.class);
|
||||
|
||||
Reference in New Issue
Block a user