Browse Source

Polishing

See gh-31962
pull/32057/head
Sam Brannen 2 years ago
parent
commit
6b905049eb
  1. 7
      spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestMappingHandlerMapping.java
  2. 7
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java

7
spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestMappingHandlerMapping.java

@ -433,12 +433,11 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi @@ -433,12 +433,11 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
private static class AnnotationDescriptor<A extends Annotation> {
private final A annotation;
private final Annotation source;
private final MergedAnnotation<?> root;
AnnotationDescriptor(MergedAnnotation<A> 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 @@ -453,7 +452,7 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
@Override
public String toString() {
return this.source.toString();
return this.root.synthesize().toString();
}
}

7
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java

@ -612,12 +612,11 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi @@ -612,12 +612,11 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
private static class AnnotationDescriptor<A extends Annotation> {
private final A annotation;
private final Annotation source;
private final MergedAnnotation<?> root;
AnnotationDescriptor(MergedAnnotation<A> 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 @@ -632,7 +631,7 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
@Override
public String toString() {
return this.source.toString();
return this.root.synthesize().toString();
}
}

Loading…
Cancel
Save