mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Fix NPE in Constructor predicate
This commit fixes a NullPointerException issue in the constructor hint predicate. Prior to this commit, a hint for a constructor was directly looked up and dereferenced a type hint without checking if there was one first.
This commit is contained in:
+5
@@ -136,6 +136,11 @@ class ReflectionHintsPredicatesTests {
|
||||
@Nested
|
||||
class ReflectionOnConstructor {
|
||||
|
||||
@Test
|
||||
void constructorIntrospectionDoesNotMatchMissingHint() {
|
||||
assertPredicateDoesNotMatch(reflection.onConstructor(publicConstructor).introspect());
|
||||
}
|
||||
|
||||
@Test
|
||||
void constructorIntrospectionMatchesConstructorHint() {
|
||||
runtimeHints.reflection().registerType(SampleClass.class, typeHint -> typeHint.withConstructor(Collections.emptyList(), constructorHint -> {
|
||||
|
||||
Reference in New Issue
Block a user