From 6b905049ebbb395e4043ee8682f4105a6dfe7585 Mon Sep 17 00:00:00 2001
From: Sam Brannen <104798+sbrannen@users.noreply.github.com>
Date: Thu, 18 Jan 2024 14:21:45 +0100
Subject: [PATCH] Polishing
See gh-31962
---
.../method/annotation/RequestMappingHandlerMapping.java | 7 +++----
.../method/annotation/RequestMappingHandlerMapping.java | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestMappingHandlerMapping.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestMappingHandlerMapping.java
index e96cb1f9fd1..3f015cd6797 100644
--- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestMappingHandlerMapping.java
+++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestMappingHandlerMapping.java
@@ -433,12 +433,11 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
private static class AnnotationDescriptor {
private final A annotation;
- private final Annotation source;
+ private final MergedAnnotation> root;
AnnotationDescriptor(MergedAnnotation mergedAnnotation) {
this.annotation = mergedAnnotation.synthesize();
- this.source = (mergedAnnotation.getDistance() > 0 ?
- mergedAnnotation.getRoot().synthesize() : this.annotation);
+ this.root = mergedAnnotation.getRoot();
}
@Override
@@ -453,7 +452,7 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
@Override
public String toString() {
- return this.source.toString();
+ return this.root.synthesize().toString();
}
}
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java
index fd1f041aa83..422be8a156a 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java
@@ -612,12 +612,11 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
private static class AnnotationDescriptor {
private final A annotation;
- private final Annotation source;
+ private final MergedAnnotation> root;
AnnotationDescriptor(MergedAnnotation mergedAnnotation) {
this.annotation = mergedAnnotation.synthesize();
- this.source = (mergedAnnotation.getDistance() > 0 ?
- mergedAnnotation.getRoot().synthesize() : this.annotation);
+ this.root = mergedAnnotation.getRoot();
}
@Override
@@ -632,7 +631,7 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
@Override
public String toString() {
- return this.source.toString();
+ return this.root.synthesize().toString();
}
}