Skip to content

Commit 305ebca

Browse files
committed
Merge branch '6.1.x'
2 parents 09ca4cd + abcc1df commit 305ebca

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ public class BindingReflectionHintsRegistrar {
6363
* @param hints the hints instance to use
6464
* @param types the types to register
6565
*/
66-
@SuppressWarnings("NullAway")
67-
public void registerReflectionHints(ReflectionHints hints, @Nullable Type... types) {
66+
public void registerReflectionHints(ReflectionHints hints, Type... types) {
6867
Set<Type> seen = new HashSet<>();
6968
for (Type type : types) {
7069
registerReflectionHints(hints, seen, type);

spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/MessageMappingReflectiveProcessor.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -83,7 +83,10 @@ protected void registerParameterHints(ReflectionHints hints, Method method) {
8383
for (Parameter parameter : method.getParameters()) {
8484
MethodParameter methodParameter = MethodParameter.forParameter(parameter);
8585
if (Message.class.isAssignableFrom(methodParameter.getParameterType())) {
86-
this.bindingRegistrar.registerReflectionHints(hints, getMessageType(methodParameter));
86+
Type messageType = getMessageType(methodParameter);
87+
if (messageType != null) {
88+
this.bindingRegistrar.registerReflectionHints(hints, messageType);
89+
}
8790
}
8891
else if (couldBePayload(methodParameter)) {
8992
this.bindingRegistrar.registerReflectionHints(hints, methodParameter.getGenericParameterType());

spring-web/src/main/java/org/springframework/web/bind/annotation/ControllerMappingReflectiveProcessor.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -84,7 +84,10 @@ protected void registerParameterTypeHints(ReflectionHints hints, MethodParameter
8484
this.bindingRegistrar.registerReflectionHints(hints, methodParameter.getGenericParameterType());
8585
}
8686
else if (HttpEntity.class.isAssignableFrom(methodParameter.getParameterType())) {
87-
this.bindingRegistrar.registerReflectionHints(hints, getHttpEntityType(methodParameter));
87+
Type httpEntityType = getHttpEntityType(methodParameter);
88+
if (httpEntityType != null) {
89+
this.bindingRegistrar.registerReflectionHints(hints, httpEntityType);
90+
}
8891
}
8992
}
9093

@@ -94,7 +97,10 @@ protected void registerReturnTypeHints(ReflectionHints hints, MethodParameter re
9497
this.bindingRegistrar.registerReflectionHints(hints, returnTypeParameter.getGenericParameterType());
9598
}
9699
else if (HttpEntity.class.isAssignableFrom(returnTypeParameter.getParameterType())) {
97-
this.bindingRegistrar.registerReflectionHints(hints, getHttpEntityType(returnTypeParameter));
100+
Type httpEntityType = getHttpEntityType(returnTypeParameter);
101+
if (httpEntityType != null) {
102+
this.bindingRegistrar.registerReflectionHints(hints, httpEntityType);
103+
}
98104
}
99105
}
100106

0 commit comments

Comments
 (0)