Skip to content

Commit cc442c5

Browse files
committed
Make HandlerFunctionDescription JDK 15 compatible
Update `HandlerFunctionDescription` so that it will work with JDK 15. Closes gh-23442
1 parent 3da300f commit cc442c5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/reactive/HandlerFunctionDescription.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ public class HandlerFunctionDescription {
2929
private final String className;
3030

3131
HandlerFunctionDescription(HandlerFunction<?> handlerFunction) {
32-
this.className = handlerFunction.getClass().getCanonicalName();
32+
this.className = getHandlerFunctionClassName(handlerFunction);
33+
}
34+
35+
private static String getHandlerFunctionClassName(HandlerFunction<?> handlerFunction) {
36+
Class<?> functionClass = handlerFunction.getClass();
37+
String canonicalName = functionClass.getCanonicalName();
38+
return (canonicalName != null) ? canonicalName : functionClass.getName();
3339
}
3440

3541
public String getClassName() {

0 commit comments

Comments
 (0)